Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

What is a header tag in html 5? In your own explanation.

I'm trying to understand this tag but other sources don't make sense

It is just a div , like section or footer, but represents the head of your html.

3 Answers

Hi Miguel,

Have a read of the below link which is by the W3C, they go into a bit of detail what it's for and how to use it.

http://www.w3.org/wiki/HTML/Elements/header

Hope that helps.

Hey Chris Upjohn,

I hope this doesn't come across the wrong way but I disliked that link immensely. The explanation was poor at best and the examples unhelpful. I found MDN to have done a much better job here.

MDN <header>

I hope that doesn't come across as derogatory, I simply found that resource very lacking.

Goodluck! --Ricky

Thanks Chris Upjohn for responding i saw this definition earlier from an other source and the word that confuses me is the word introductory from the following definition from below

"The header tag element represents a group of introductory or navigational aids."

so to me it seems vague what its referring to in a html context and i play with the code from this source

http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_header

To understand this more but I see no clear understanding how this tag is useful since i can do that already with a h1 tag right? just saying i was playing with that code example in the link above just saying if you can explain why this is a useful tag i will really appreciate it.

It is kind of a future looking element which right now has minimal value but is still good to use. It is the same to most things as

<div id="header">

The difference being lots more technologies are automating parsing HTML be it a search engine, screen research, or someone scraping a website for use in a program or app. This will enable those programs to more accurately understand this element. "Typically" a header contains something like a site title, logo, navigation, important information, or other top priority things about a website. Using <header> will enable technology to prioritize <header> over <div>.

Keep in mind HTML5 is new and may not always be needed. It is up to you as a developer to make the decision on what is needed. If their is some new cutting edge feature you want use it, if not no harm no foul.

Goodluck! --Ricky

Hey I just saw your comment but couldn't you do that already with other tags? so its like the tag head? and the thing i notice about that header tag when i was playing with it in this site a code generator site

http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_header

is that it has the p tag and h1 h3 tags in it that's where i got confuse today your comment makes sense more but from this site it threw me off =Q just saying because when i erased the header tag and saw the results it still looks the same if i would of not use the header tag I still don't see how you can have any use for this if you can do the same thing with out that header tag

It is simply a containing block. If there is not CSS styling on it removing it wont matter. It all depends on how you build your site. Sometimes it is needed sometimes not.

Goodluck! --Ricky

I will just assume that its the top section of a page where you can put a logo,title, navigation, table of contents, and a search form just like that picture correct me if i'm wrong i don't mean to complicate this i'm just saying http://www.html-5-tutorial.com/images/layout.gif