Raphael Essoo-Snowdon
Raphael Essoo-Snowdon

Reputation: 31

HTML5's New <header> Element

I understand its functionality. Am I right to believe we now sandwich all h1 to h6 tags in between it? Am I missing something?

Please be gentle, I'm just trying to learn.

Upvotes: 3

Views: 348

Answers (3)

Mahima
Mahima

Reputation: 509

Header tag in html5 is basically used to contain the header section of a page. To group H1...H6 tags, tag has been introduced in html5. So we can use this tag. And these tags are useful for web crawlers as well. If you use hgroup tag in your page, then at the time of crawling search engines treat it as something important and gives more weightage to it.

While studying about impotance of html5 tags for SEO, i found this link. link text

Upvotes: 0

Ryan Doherty
Ryan Doherty

Reputation: 38740

According to the spec:

A header element is intended to usually contain the section's heading (an h1–h6 element or an hgroup element), but this is not required. The header element can also be used to wrap a section's table of contents, a search form, or any relevant logos.

http://dev.w3.org/html5/spec/Overview.html#the-header-element

So no, you don't have to wrap all your headings in a header tag. It's for a section's heading and/or related elements.

Upvotes: 3

zachaysan
zachaysan

Reputation: 1826

Header is the element that covers the heading of any section. This includes the webpage itself, but could also be the heading of a separate section. It helps to think about it by assuming that in some circumstances people may want to reuse only part of your webpage somewhere else.

Say a site that aggregates a series of articles on professions. If you have a page that has 3 separate profession articles, "Fireman", "Policeman", and "Soldier" and each article was wrapped in an <article> tag and each had a <header> tag that contained the heading for each article, then the aggregating site could easily roll up your articles. The same is true for search engines and web crawlers.

Upvotes: 1

Related Questions