Lessons · HTML and CSS · one h1: what this page is
One h1: what this page is
One h1 per page, naming this page. It is the root of the outline.
Hone is a place to practise programming. This is one of its lessons, written out in full and free to read without an account.
What it is for
Jumping to the h1 is how many people start on a new page. Without one they start at whatever heading comes first, usually inside the navigation.
How to think about it
Make it answer 'where am I'. On a search results page that is 'Search results for kettle', not the site's name -- the site name is on every page and so distinguishes nothing.
Worked example
<main><h1>Search results for kettle</h1>…</main>Inside main, naming this page rather than the site.
Your turn
How many h1 elements a page should usually have.
Write a page and watch it render
The trap
Several h1s leave a reader with several answers to 'what am I looking at', which is the same as none.
Practise one h1: what this page is on HoneA question on it now, a coding challenge where there is one, and it is remembered for review. Free, no email needed.