197k views
1 vote
Describe the difference between absolute and relative links. Which would you use when?

User Fruggiero
by
4.9k points

1 Answer

4 votes

An absolute link is used when the href has a link that includes the entire domain name. A relative link is a path to a resource relative to the current HTML document’s location, according to how the web server is determining that location. Most often, an HTML document’s location is determined by its directory.

If I wanted to refer someone to a website, I would use absolute links. If I wanted to refer to links on the same server as the page that contains them, I would use relative links.

Hope this helps :)

User Yueyanw
by
4.2k points