id
Creates a unique target on the page.
Learn HTML Bookmarks with practical HTML examples for navigation, images, alt text, media behavior, metadata, accessibility, SEO and live practice.
HTML links and media
HTML bookmarks use fragment links. A link such as href="#pricing" jumps to the element with id="pricing".
Bookmarks are useful for long lessons, documentation pages, FAQ sections, tables of contents and skip links.
They are small, but they make a page feel faster because users can jump straight to the part they need.
Creates a unique target on the page.
Links to the element with that id.
A list of links that jumps to page sections.
A keyboard-friendly link that jumps past repeated navigation.
Syntax and structure
If href="#practice" is used, the page needs an element with id="practice".
<nav aria-label="On this page"> <a href="#overview">Overview</a> <a href="#practice">Practice</a> <a href="#checklist">Checklist</a> </nav> <section id="overview">...</section> <section id="practice">...</section> <section id="checklist">...</section>
<a href="#pricing">Pricing</a> <section id="prices">...</section> <section id="faq">...</section> <section id="faq">Duplicate id</section>
Rules that matter
Clickable and visual HTML affects how people move, scan, trust and share a page. The details are small, but the user experience impact is large.
The fragment after # must match the id value.
An id should appear once per page.
Changing ids can break shared URLs and internal links.
id="pricing" is easier to maintain than id="x7".
Skip links let keyboard users jump to main content.
Only create bookmarks for sections people may actually need to jump to.
Production thinking
This matters because long pages need navigation inside the page, not only between pages. Bookmarks make deep content usable.
Bookmarks and skip links help keyboard and screen reader users move through long pages without repeating the same navigation every time.
Fragment links are often shared directly. Treat important ids as part of your URL contract.
Clear section ids and internal table-of-contents links can help search engines understand page structure and may support sitelink-style navigation.
Live code lab
Edit the HTML or CSS, then use Run to refresh the preview. The preview is isolated, so links and forms stay inside this practice area.
Mini assignment
Practice assignment
Try it yourself
Self-check
Do not only read this page. Answer these questions out loud or write the answers in your own notes. If one answer feels vague, revisit the examples before moving on.