
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
How to link pages using absolute URL in HTML?
In HTML different HTML elements have attributes that contain link to the other resources. The values of these attributes are URL’s, these can be absolute or relative URL’s.
An absolute URL used to link to resources on web page, it includes the website address.
Absolute URL’s never changes.
We can also use absolute URL to link to resources within same site on the web page.
Following link includes the protocol and domain (host name) making this an absolute URL.
<a href="www.Google.com">Link text…</a>
Absolute URL begins with the domain where the file is located.
Syntax
Following is the syntax to link a page using absolute URL.
<a href="absolute URL">Link text…</a>
Example
Following is the example program to link a page using absolute URL.
<!DOCTYPE html> <html> <head> </head> <body> <h3>HTML-HyperText Markup Language </h3> <a href="https://www.youtube.com/watch?v=qz0aGYrrlhU">HTML tutorial</a> </body> </html>
Following is the output for the above example program. The domain address is YouTube and when we click on the link it will directly navigate us to the different page of the same website.
Example
Following is the example program to link a page using absolute URL.
<!DOCTYPE html> <html> <head> <title>How to link pages using absolute URL in HTML?</title> </head> <body> <h2>Click the link below to redirect to instagram login page</h2> <a href="https://www.instagram.com/accounts/login/">Instagram login</a> </body> </html>
Example
Following is the example program to link a page using absolute URL and changed the style of the Hyperlink by using CSS.
<!DOCTYPE html> <html> <head> <title>How to link pages using absolute URL in HTML?</title> <style> a:link { text-decoration: none; } a:visited { text-decoration: none; } a:hover { text-decoration: underline; } a:active { text-decoration: underline; } </style> </head> <body> <h2>Click the link below to redirect to facebook login page</h2> <a href="https://www.facebook.com/login/">facebook login</a> </body> </html>
- Related Articles
- How to link pages using relative URL in HTML?
- How to specify the URL of the page the link goes to in HTML?
- How to use Python Regular expression to extract URL from an HTML link?
- How to convert html pages to pdf using wkhtml2pdf
- How to include CSS in HTML Pages
- How to author fast-loading HTML pages?
- Difference between an Absolute URL and a Relative URL
- How to Parse HTML pages to fetch HTML tables with Python?
- How to link a submit button to another webpage using HTML?
- How to link jQuery in HTML page?
- How to create HTML link that doesnt follow the link?
- Styling html pages in Node.js
- How to use URL input type in HTML?
- How to create a bookmark link in HTML?
- How to test if a URL string is absolute or relative - JavaScript?
