-
Hajipur, Bihar, 844101
Hajipur, Bihar, 844101
HTML5 Basics
HTML Introduction
HTML Editors
HTML Basic
HTML Elements
HTML Attributes
HTML Headings
HTML Paragraphs
HTML Styles
HTML Formatting
HTML Quotations
HTML Comments
HTML Styling and Design
HTML Links and Media
HTML Layout and Structure
HTML Tables
HTML Lists
HTML Block & Inline
HTML Div
HTML Classes
HTML Id
HTML Head
HTML Layout
HTML Responsive
HTML Computercode
HTML Semantics
HTML Forms
HTML Forms
HTML Form Attributes
HTML Form Elements
HTML Input Types
HTML Input Attributes
Input Form Attributes
HTML Graphics
HTML APIs
HTML Advanced Topics
HTML links (or hyperlinks) allow users to navigate from one page to another, either within the same site or to an external site. Links are created using the <a>
(anchor) tag.
<a href="URL">Link Text</a>
href
: The attribute that holds the destination URL.
Link Text
: The clickable text shown to the user.
<a href="https://www.google.com">Visit Google</a>
Type | Example |
---|---|
External Link | <a href="https://example.com">Go to site</a> |
Internal Link | <a href="about.html">About Us</a> |
Email Link | <a href="mailto:info@example.com">Email Us</a> |
Telephone Link | <a href="tel:+911234567890">Call Now</a> |
Anchor Link | <a href="#section2">Go to Section 2</a> (on same page) |
Use the target="_blank"
attribute:
<a href="https://www.google.com" target="_blank">Open in New Tab</a>
<a href="https://example.com" title="Visit Example Site">Visit</a>
When hovered, the user sees a tooltip.
<a href="https://example.com">
<img src="logo.png" alt="Site Logo">
</a>
By default:
Unvisited link = blue
Visited link = purple
Active link = red
You can change these styles using CSS.
<style>
a {
color: green;
text-decoration: none;
}
</style>
Q1. Create a link to https://www.google.com
.
Q2. Add a link that opens in a new tab.
Q3. Make an internal link to a file named contact.html
.
Q4. Add a mailto:
link to send an email.
Q5. Create a link that opens the dialer with a phone number.
Q6. Use #footer
to link to a section at the bottom of the same page.
Q7. Add a title to a link that says “Go to Home Page”.
Q8. Create an image link using your logo.
Q9. Change link color to green and remove underline using CSS.
Q10. Create a navigation menu using multiple <a>
tags.
HTML5 Basics
HTML Introduction
HTML Editors
HTML Basic
HTML Elements
HTML Attributes
HTML Headings
HTML Paragraphs
HTML Styles
HTML Formatting
HTML Quotations
HTML Comments
HTML Styling and Design
HTML Links and Media
HTML Layout and Structure
HTML Tables
HTML Lists
HTML Block & Inline
HTML Div
HTML Classes
HTML Id
HTML Head
HTML Layout
HTML Responsive
HTML Computercode
HTML Semantics
HTML Forms
HTML Forms
HTML Form Attributes
HTML Form Elements
HTML Input Types
HTML Input Attributes
Input Form Attributes
HTML Graphics
HTML APIs
HTML Advanced Topics