0 added
0 removed
Original
2026-01-01
Modified
2026-03-09
1
<p>Although our blog is on the web, but when we’re working on it, we do it on our computer-that is,<i>locally</i>. So we can test changed pages before publishing them, links to other blog pages should open the file on our computer, and not from somewhere on the Internet. You need to use a special address for these types of links, such as, for example:</p>
1
<p>Although our blog is on the web, but when we’re working on it, we do it on our computer-that is,<i>locally</i>. So we can test changed pages before publishing them, links to other blog pages should open the file on our computer, and not from somewhere on the Internet. You need to use a special address for these types of links, such as, for example:</p>
2
<a href="day-2.html">Second blog entry</a><p>This type of address is called<i>relative</i>. In contrast to “normal” addresses, it does not contain a full website address. In order to resolve a relative address and reach its destination, the browser must decode it. To do this, it typically starts with the position of the current page. For example, there are two files in the c:/blog folder:</p>
2
<a href="day-2.html">Second blog entry</a><p>This type of address is called<i>relative</i>. In contrast to “normal” addresses, it does not contain a full website address. In order to resolve a relative address and reach its destination, the browser must decode it. To do this, it typically starts with the position of the current page. For example, there are two files in the c:/blog folder:</p>
3
c:/blog/ |-<b>index.html</b>// This page is open in the browser |-inner.html<p>The page c:/blog/index.html is open in the browser, and it contains a link with a relative address inner.html. In order to follow this link, the browser looks at the location of the open page and replaces the last part in it:</p>
3
c:/blog/ |-<b>index.html</b>// This page is open in the browser |-inner.html<p>The page c:/blog/index.html is open in the browser, and it contains a link with a relative address inner.html. In order to follow this link, the browser looks at the location of the open page and replaces the last part in it:</p>
4
c:/blog/index.html + inner.html // Replace the last part c:/blog/inner.html // Open this file<p>Relative addresses work not only for files on a computer, but also for pages on a network. If you were to publish the two files from the example on the Internet (without changing their relative position to each other), then the link would still work. The relative address inner.html on the page https://site.com/blog/index.html can be decoded as follows:</p>
4
c:/blog/index.html + inner.html // Replace the last part c:/blog/inner.html // Open this file<p>Relative addresses work not only for files on a computer, but also for pages on a network. If you were to publish the two files from the example on the Internet (without changing their relative position to each other), then the link would still work. The relative address inner.html on the page https://site.com/blog/index.html can be decoded as follows:</p>
5
https://site.com/blog/index.html + inner.html // Replace the last part https://site.com/blog/inner.html // Open this address<p>Let’s add some more relative links to the main blog.</p>
5
https://site.com/blog/index.html + inner.html // Replace the last part https://site.com/blog/inner.html // Open this address<p>Let’s add some more relative links to the main blog.</p>