[whatwg] Footer inside header

Benjamin Hawkes-Lewis bhawkeslewis at googlemail.com
Wed May 2 14:32:04 PDT 2012


On Fri, Apr 27, 2012 at 3:41 AM, Andrés Sanhueza
<peroyomaslists at gmail.com> wrote:
> 2012/4/26 Benjamin Hawkes-Lewis <bhawkeslewis at googlemail.com>:
>>
>> On Apr 26, 2012 5:39 PM, "Tab Atkins Jr." <jackalmage at gmail.com> wrote:
>>>
>>> according to the definition of
>>> <footer>, it appears that authorship information is most appropriate
>>> to put there.  But sometimes the byline is placed inside the "header"
>>> area, which is reasonably marked up with a <header>.
>>
>> Isn't that use case addressed by <address>?
>
> No. <address> is much narrower and indicated in the spec as such.
> Bylines can also contain the date or, in blog post, links to tags.

Good point.

Can you provide an example where you'd to put a <footer> *inside* a
<header> rather than after it like so:

 <article>
   <header>
     <hgroup>
       <h1>Headline</h1>
       <h2>Subhead</h2>
     </hgroup>
   </header>
   <footer>
     <p><time datetime="2012-04-30">30 April 2012</time></p>
     <p><address>John Doe</address></p>
     <p>Tags:</p>
     <ul>
       <li><a href="/tags/politics">politics</a>
       <li><a href="/tags/politics">environment</a>
     </ul>
   </footer>
   <p>Article body…</p>
 </article>

It's worth noting that the definition of <header> is broad enough to
allow byline, date, and tags ("group of introductory or navigational
aids"):

  http://www.whatwg.org/specs/web-apps/current-work/multipage/sections.html#the-header-element

So you could also do:

 <article>
   <header>
     <hgroup>
       <h1>Headline</h1>
       <h2>Subhead</h2>
     </hgroup>
     <p><time datetime="2012-04-30">30 April 2012</time></p>
     <p><address>John Doe</address></p>
     <p>Tags:</p>
     <ul>
       <li><a href="/tags/politics">politics</a>
       <li><a href="/tags/politics">environment</a>
     </ul>
   </header>
   <p>Article body…</p>
 </article>

Personally, I think it might be easier to understand and provide user
agent behaviors if we to define header and footer as the header and
footer of sections, and then require:

   [start section]
   [zero or more aside elements]
   [zero or one header element]
   [other material]
   [zero or one footer element]
   [zero or more aside elements]
   [end section]

This way, if you hit a navigation key for footer you go to the end of
a section, like you'd expect.

Allowing <aside> before <header> or after <footer> is mostly a
concession to ad publishing.

In other words: define <header> and <footer> by their structural role
rather than their contents per se.

--
Benjamin Hawkes-Lewis


More information about the whatwg mailing list