Relative link is a link that is directly connected to the path that shows the file itself.
Here, the path can be anything that comes after the domain name.
It includes directories and slug too. Because relative link is not like a formal link structure.
In simple words, you can understand that a relative link is a Short link of a website that directly connects users to a particular file.
If you find any website for e.g. Monex.com and you want to go to sites about.
Then just by typing “monex.com/about” you will easily reach the about of that website.
This type of small links are known as relative link.
What is a relative link in HTML for example?
A relative link is a link that is used to add a page in a website. Instead of showing complete URL, relative link only shows the relative link paths as their name mentioned.
Example : /about, /example etc.
How do you use the relative link?
As I said relative link provides a very short but accurate direction of the website to its users. Relative links are normally used to transfer users to different categories or different points in the same domain.
By using relative link in your website you can directly told user where to go in your site. Because each relative link has it’s own path name.
What are the pros of relative link ?
Relative link has numerous benefit. Some of the benefits are discussed below –
What are the disadvantages of relative links ?
Hense relative links has so many benefits. It has some disadvantages too.
What is the difference between absolute and relative links ?
The main difference between the absolute and relative links are :
Absolute links contains the complete information but relative links only contain the path files of a website.
Relative link is dependent in nature but absolute links are independent in nature.
Relative link is the small portion of the whole but an absolute link is the total of whole.
Relative links sometimes become confusing but the absolute link is very easy to understand as it contains complete information.
Relative links can be coded easily but absolute links take little more time to code than relative link.