HTML: Relative and absolute paths

This entry is part 23 of 34 in the series HTML

Paths that contain a complete address that anyone can use to get to that page are called absolute path.

When linking to files in the same website, you do not need to include the complete path.  This is called relative path.

<!DOCTYPE html>
<html>
<head lang='en'>
    <meta charset='UTF-8'>
    <title>Link path</title>
</head>

<a href='https://codecrawl.com/code/ushuaia.html'><h2>Ushuaia, South America</h2></a>

<a href='ushuaia.html'><h2>Ushuaia, South America</h2></a>

</body>
</html>

Line 8 is is using absolute path and line 10 is using relative path.  They will both lead to the same link.

Series Navigation<< HTML: Creating hyperlink to a webpage
HTML: Setting a target window >>