140

Are <section> tags allowed to be included within another <section> tag? Will it validate in HTML5?

2
  • 12
    Ask validator.w3.org
    – BoltClock
    Mar 28, 2012 at 22:10
  • I don't understand the explanations given here but validator.w3.org validates nested sections
    – xtian
    Oct 4, 2022 at 11:11

3 Answers 3

192

Yes! w3 encourages you to explicitly wrap sections in elements of sectioning content, instead of relying on the implicit sections generated by having multiple headings in one element of sectioning content and nested <section>'s are allowed.

13

Yes, since a website is generally divided into one or more sections, use it as long as you feel it describes the structure. A layout can have 1 or even tens of SECTION elements, just know that it is NOT a DIV replacement :) DIVs are still used and recommended (usually for grouping means).

1
  • 6
    This seems to address sibling sections. I don't see how it answers the question about nested sections.
    – ANeves
    Oct 22, 2018 at 20:54
6

Yes, that will work fine. At least, it works for me.

You can try it out here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.