Horje
What is Absolute URLs vs. Relative URLs | HTML Links Code
What is Absolute URLs vs. Relative URLs

Both examples above are using an absolute URL (a full web address) in the href attribute.


Full Example of Absolute URLs vs. Relative URLs

A local link (a link to a page within the same website) is specified with a relative URL (without the "https://www" part):
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h2>Absolute URLs</h2>
<p><a href="https://www.w3.org/">W3C</a></p>
<p><a href="https://www.google.com/">Google</a></p>

<h2>Relative URLs</h2>
<p><a href="html_images.asp">HTML Images</a></p>
<p><a href="/css/default.asp">CSS Tutorial</a></p>

</body>
</html>

Output should be:

Full Example of Absolute URLs vs. Relative URLs



Read Full::
HTML Links Code
Category:
HTML Code
Sub Category:
HTML Links Code
Uploaded:
7 months ago
Uploaded by:
Admin
Views:
1

Related Articles
What is HTML Links HTML Links Code
How to create HTML Links - Syntax HTML Links Code
How to create HTML Links The target Attribute HTML Links Code
What is Absolute URLs vs. Relative URLs HTML Links Code
How to use an Image as a Link HTML Links Code
How to use Link to an Email Address HTML Links Code
How to create Button as a Link HTML Links Code
How to use a title in Link HTML Links Code

Single Articles
Full Example of Absolute URLs vs. Relative URLs

Share on: