I’m just wondering how to use the
footer element the right way.
Although those elements are not meant to be presentational I most often find people using a likewise presentational structure for marking up their articles (header always on top, footer at the end):
<article> <header> <h1>This is my headline</h1> <!--Some additional info like pubdate and author--> </header> <div class=“entry“> <p>…</p> <p>…</p> <p>…</p> </div> <footer> <!--Some additional info like where it is archived and some tags--> </footer> </article>
Based on research, mood, our design or whatsoever we decide which content to put into the header and which to put in the footer. So we decide rather presentational like “Should this be on top? Ok, let’s put in the header” or “Should it appear at the end? Let’s put it in the footer.”
Wouldn’t it be better to think the other way around: “We have this piece of content. What’s the appropriate element to mark it up, header or footer?” Let’s say we put the author info into footer because the spec says so. If we then decide to put the author info on top, I think it should look something like this:
<article> <h1>This is my headline</h1> <footer> <!--author info and copyright info goes here --> <!--Some additional info like where it is archived and some tags--> </footer> <div class=“entry“> <p>…</p> <p>…</p> <p>…</p> </div> </article>
The spec also says that the
footer element doesn’t need to appear at the end of a section, so this should be ok.
But what if we want to show some additional info at the end of the section, can we use another footer element within that same section?
Could likewise the header element appear at the bottom with some info like table of contents, as the spec suggests?
What do you think?
Commenting is closed for this article.