treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] HTML5 Validation Error - Header Not Descendent?

  • Hi there,

    Is anybody aware of this error when they run their site through the validator?

    The element header must not appear as a descendant of the footer element.

    An example of my code is as follows:

    <section class="col2">
    <header>
    <h1>Other Information:</h1>
    </header>

    <nav>
    <ul>
    <li><a href="#">About Us</a></li>
    <li><a href="#">Contact Us</a></li>
    <li><a href="#">Site Map</a></li>
    <li><a href="#">Privacy Policy</a></li>
    </ul>
    </nav>
    </section><!--col2-->


    I thought I coded it right, but maybe I'm missing something?
  • Oh, hmm -- I may understand the error.

    You see, I have a footer, a really big footer with lots of information, and it does have header elements in it. So, is it true to believe that you can't have
    <header>'s
    in a really big
    <footer>
    ?
  • Last I checked you were not supposed to put a 'header' inside the 'footer' element.
  • Oooh you know it makes sense, until I see a design that has a headline in it and then it stumps me. :)
  • You can put h1, h2, ... , h6 in your footer but not header blocks.
  • You can also use <hgroup> Which can contain h1-h6s.