Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why <h1> in <header>?

Tags:

html

header

I just finished the Code School's Functional HTML5 & CSS3 and I noticed several times they emphasized that the <header> element should contain <h1> heading (not <h2>, <h3> etc.) but they did not explain why.

Why is that? What makes the <h1> so special that it is the one that we should include in <header>?

like image 944
Eleeist Avatar asked Feb 20 '23 07:02

Eleeist


2 Answers

the header of the page is like the header of a document, you'll usually find the main title of the document there. The main title of a webpage is usually put into an h1, but headers can contain lots of other things like a logo, publication date and other metadata. On many websites, the sit's header also contains its navigation.

like image 73
bigblind Avatar answered Feb 23 '23 09:02

bigblind


h1 is the primary (ie: the most important) header.

The header tag is not limited to only containing the h1, but as it is the most important header on the page, that may often be the case.

like image 45
podiluska Avatar answered Feb 23 '23 10:02

podiluska