Can I use header/footer tags inside the main/Section tag?

Asked

Viewed 890 times

3

I’d like to know if you can, within the element <main>, or <section>, put the tags <header> and <footer>.

For example:

<section>
   <header>topo da section</header>
      conteudo da section
   <footer>rodape da section</footer>
</section>

or

<main>
  <header>topo da section</header>
    conteudo da tag main
  <footer>rodape da section</footer>
</main>

that way is correct??

2 answers

7

Yes, it is allowed.

According to the W3C specification, both the element <section> as to the <main> allow as content the elements classified as flow content, which include the elements <header> and <footer>.

For example, a blog post:

<main>
    <header>
        <h1>Minha espetacular publicação<h1>
    </header>
    <section>
        <p>Ok, não é tão espetacular assim</p>
    </section>
    <footer>
        <time datetime="2018-08-28 20:00">Publicado em 2018-08-28 20:00</time>
    </footer>
</main>

2

Come on, a section is like belonging to a person’s trunk, the header to the head and footer to the feet, if you put the footer inside a Ction the feet would be in the stomach but it would still be possible to use it only it would be strange(kkk). Already when it comes to the main he can not be 'son' of these elements.

  • got it...so just the most can not be son, however, he can have children...that’s it then, right??? thanks guys!! you are 10!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.