To link pages using relative URL in HTML, use the <a> tag with href attribute. Relative URL is used to add a link to a page on the website. For example, /contact, /about_team, etc.
Everything inside <a>…</a> tag becomes a hyperlink. Some of the attributes of <a> tag are listed below,
|Sr.No.||Attribute & Description|
Specifies the URL
Specifies the connection between current and linked document. Values can be nofollow, external, author, bookmark, etc.
Specify where the link will open. Values include _self, _parent, _self, etc
You can try to run the following code to link pages using relative URL in HTML
<!DOCTYPE html> <html> <head> <title>HTML Relative URLs</title> </head> <body> <p> Our <a href="/about/about_team.htm">Team</a> comprises of programmers, writers, and analysts. </p> </body> </html>