The link is one of the most important concepts for the HTML-document. Wandering on the Web, you click on the buttons and texts and you get to the desired page. These pages can be located on the same server, and also on a server which is located on the other side of the planet. But in both cases, the transition takes place almost instantaneously.
And how do you know where to click to go to another page? Either visually (links have a different color, and underlined) or by the mouse cursor, which is converted into the palm. Consider the details:
<Html> <Head> <Title> Links in html </ title> </ Head> <Body> Visit <a href="http://www.google.com"> Google search engine </a> </ Body> </ Html>
If you click the link, you will go to www.google.com. Note that when you bring the mouse cursor to the link, the status bar displays the address to which the link leads.
Absolute and relative addressing
Consider an example. Suppose we have a site with a registered domain – mysite.com. All pages are stored on the server in the two public and private folders. The public folder contains the index.html and articles.html files and the private folder contains price.html and cinema.html. So our site has the following structure:
In the absolute path, the absolute address is used. In this example, the absolute address of the index.html page is:
In relative addressing, the path is the directory where the source file is stored. For example, if we want to place a link from the index.html page (the source file) to the articles.html page, given that both pages are in the same directory (have the same level), it will look as follows:
<a href = "articles.html">
If we want to make a link from the index.html page to the price.html page, given that the pages are in different directories, it will look as follows:
Two points mean a command to rise in the hierarchy of folders on a higher level.
All external links have an absolute address. Inner links (within the site) can be set in any way. Each has its pros and cons. If you decide to change the domain while using an absolute address, you will have to redo all the links on your site. With relative addressing, you will not have such problems while the folder structure will not change.
Thanks for your attention!
Do you need help with your HTML/CSS assignment? You’ve come to the right place! First of all, check out the free samples and articles at our blog. We want to remind you, however, that you are not allowed to use any of the information provided without proper references to the source, or else it will be considered as plagiarism. Secondly, you can always order a custom paper in case you still have troubles completing your assignment.
What do you need to do to get started? First of all, fill in the short form you can find in the top right corner of the page. After that, you will be taken to a page with a longer form, where you will be asked to specify some details of your HTML/CSS assignment, such as the topic, additional commentary, sources that are obligatory to use, etc. After that, our experts who are interested in working on your assignment start bidding for it, and you can choose the one you like the most. You can find the information about each expert at his or her personal profile page. You can also chat with the expert to clarify the questions you have. Check other samples at our blog and place your order to get quality work done for you.