HTML links connect web pages, documents, sections, email addresses, and external resources.
In this lesson, you will learn how HTML links work, how to create different types of links,
and how to write SEO-friendly and accessible links.
What Are HTML Links?
HTML links, also called hyperlinks, allow users to navigate between pages,
websites, files, and sections of a page. Links are created using the
<a> (anchor) element.
<a href="https://example.com">Visit Example</a>
When users click a link, the browser loads the destination specified in the
href attribute.
HTML Link Syntax
<a href="url">Link Text</a>
<a> defines the anchor element.
href specifies the destination URL.
The content between the tags becomes clickable.
HTML Links Cheatsheet
The following table contains the most commonly used HTML link patterns
every developer should know.
Using images as links without meaningful alt text.
Key Takeaways
HTML links are created using the <a> tag.
The href attribute defines the destination.
Links can point to pages, files, email addresses, phone numbers, and bookmarks.
Use descriptive anchor text for SEO and accessibility.
Use relative URLs for internal pages and absolute URLs for external websites.
Always use secure external link attributes when opening new tabs.
Pro Tip
Search engines pay close attention to anchor text. Instead of generic links,
use descriptive phrases such as "Learn HTML Attributes" or
"View HTML Formatting Examples".
You now understand HTML links, URLs, bookmarks, downloads, email links,
and SEO best practices. Next, learn how HTML images work and how to optimize
them for accessibility and performance.