In this post we will teach you everything you need to know about links, absolute and relative HTML paths: definition, structure and practical examples. ENTERS!
Welcome to another post.
Thanks to the links is that you can go from web page to web page investigating and indicating about any subject, and they exist practically from the beginnings of Internet.
Commonly also they are called hyperlinks, both have the same meaning and denote the same function. The structure of a link is the next:
- Text: it is also known as «anchor text» and is the text which will contain the link or hyperlink to another web page destination.
- Hyperlink: is destiny which is placed in the anchor text. Here you must specify the web page destination.
Next, we will show you how you can put into practice the insertion of links (with their respective relative and absolute paths) in HTML.
Links in HTML
The Default HTML links look blue, that if you hover the mouse over it, it will turn into a hand pointing to the anchor text. The length of the anchor text is delimited by the number of words that the link covers.
If you want to create a link, you must follow the following structure:
Mention that, in order to close this tag, you must use its counter tag which is "", otherwise, the anchor text will take the length of all the characters written after the link is opened.
They are all those links that point to a web address or URL, is also known daily as "link". This link is the most common on the internet, and the one that we recommend ALWAYS use, since among good SEO practices, it is recommended to use it.
These absolute path links in HTML can be both external (links from your own website), or external links (links to other websites).
Examples of absolute paths in HTML
Below we will give you some clear examples which will explain to 100% the use of the absolute paths within your HTML document. Pay attention to each type of example as it describes different types of absolute paths well.
As you can see, all the links come within the "href" attribute of the HTML " " tag , and can be of different types of web addresses. You just have to put that link directly between the quotes of that attribute.
They are local HTML links that search for some content within the computer or server. We recommend using relative paths as little as possible in your HTML document as they could cause future confusion due to their structure.
This structure works in the same way as an absolute path, but relative paths have a different way of working or employing in the HTML document.
First, let's look at a concrete example of a relative HTML path so that we can understand what this question is about:
Generally, relative paths are used under programming languages that run behind the server, because exposing this type of internal addresses of a server can carry risks. However, there are other types of relative paths within HTML that can be used:
Examples of relative paths in HTML
These relative path HTML links direct to the contact section of the website where this hyperlink is placed. If the site is Facebook, then it would go to "facebook.com/contact".
Another example is the use of these routes to go to certain other sections, using point navigation:
Point navigation indicates that it will go back a directory, and look for the index HTML file for that site. If, for example, the user is found in "sections / example.html", the navigation indicates that he should go to "/index.html", leaving the "sections" directory.
It can be worked in more directory levels, as explained below:
We hope that in this informative article you have learned quite a bit about links (both relative as absolute paths) in HTML. These links may be of interest to you:
Did you understand the issues addressed? Comment your doubts in the comments!
See you in another post.