Timofey Drozhzhin
Timofey Drozhzhin

Reputation: 4714

Is it valid to have a <section> tag inside another <section> tag?

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

Upvotes: 152

Views: 83510

Answers (3)

SirCommy
SirCommy

Reputation: 260

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).

Upvotes: 13

john_science
john_science

Reputation: 6541

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

You can try it out here.

Upvotes: 6

Oleg
Oleg

Reputation: 24988

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.

Upvotes: 211

Related Questions