Search code examples
htmlheadersemantics

Correct HTML5 site header


I just read about the header tag not being equal to section. The author says, header should not be used outside a section, but he doesn't tell us, how the sites header and footer have to look like. Are they sections? Divs maybe? Or does body count as a section and I can use header and footer like I used to?


Solution

  • The header is the page title. In HTML5, there is a new tag named <header> that is used to format this section. The header usually contains the site name and logo, maybe a notice, and sometimes the page name for simple, one-page sites. A <section> is a block of content in the page. A header is basically a special section with a tag just for it because it is so common in webpages, similar to how <nav> is a special section on the page just for navigation links, but is not put in a <section> tag.