tags:

views:

87

answers:

3

In this tutorial: http://railstutorial.org/chapters/filling-in-the-layout#top

There is "header"

I know that in HTML there is "head"

But, what is <header> ?

Thanks.

+3  A: 

<header> is a semantic tag added in HTML5. It's the HTML5 equivalent of using <div class="header"> for a header element in your page.

Daniel Vandersluis
Why the downvote?
Daniel Vandersluis
It is not the header of the page but of a section. So <div class="header"> is a better equivalent. (i did not do the down vote).
nhnb
Oops, that's what happens when I write an answer early in the morning.
Daniel Vandersluis
+10  A: 

<header> is one of several new tags in HTML5 that are supposed to replace <div> for some specific situations. In particular, the "header" part of your page - whatever that is, usually the part that would be wrapped in <div class="header"> - in HTML5 you should use <header> instead.

Chapter 3 of Dive into HTML5 by Mark Pilgrim does an excellent job going into the details of when and why to use the new <header> element.

Rex M
Keep in mind that html 5 is at draft state and <header> is one of the controversial changes: http://lists.w3.org/Archives/Public/public-html/2009Aug/0389.html
nhnb
@nhnb it is highly unlikely those elements will be removed or changed at this phase.
Rex M
In case you did not notice: The blog posting, I linked to, is from the most important browser vendor. In general I have trouble to take a spec serious which has two official (!) versions that are incompatible to each other.
nhnb
A: 

The "header" element does not exist in the current html specification so it is ignored (but may be styled using css of course). It is part of the current draft for the upcoming HTML version 5.

It is not related to the "head" element which contains information page the page but no structure.

nhnb
It is certainly not ignored. Ian Hickson, editor of the HTML5 spec, has already said that most of the spec is stable and can be safely implemented - which it has, by every major browser, including the upcoming version of IE.
Rex M
It is ignored at the moment by the browsers that are in wide use (IE up to 8, Firefox up to 3.6.8). I disagree on it being a good idea to build productive work up on specifications in draft state.
nhnb
Especially since header is one of the attributes that Microsoft does not consider to be a good idea: http://lists.w3.org/Archives/Public/public-html/2009Aug/0389.html
nhnb
One downvote more, please, so that i can get the Peer Pressure badge.
nhnb
Most browsers treat it as an unknown element, in most cases this means it is treated as an inline element with no semantics attached to it. In the case of Internet Explorer it also means that it is not accessible to the CSS engine without a JScript shim. This is as good as "ignored".
David Dorward