Tagg the Builder saysAn id is a unique name for a single element — for in-page links, label targets, and precise JS/CSS hooks.
An id must be unique on the page. Use it to jump to an element with #id in a link, to connect a <label for> to an input, or to grab one element in JavaScript with getElementById.
For styling, prefer classes — ids have very high CSS specificity, which makes their rules hard to override later. Think of an id as a name tag for exactly one thing.
Power-ups you unlock
id="name" — must be unique per page
Targets: #id links, label for=, getElementById
High CSS specificity — avoid for general styling
One id per element; one element per id
The Unclosed Tag attacks — common mistakes
Reusing the same id on multiple elements (breaks links and JS)
Styling with ids and then fighting their specificity
Spaces or starting with a digit in id names
Boss battleGive a section an id and link to it from the top of the page. Then connect a <label for> to an <input id> and click the label to focus the input.