7 ms·
It looks like a <main> element is allowed to have div ancestors: https://html.spec.whatwg.org/multipage/grouping-content.html#hierarchically-correct-main-elemen
by okbake 7y ago
It looks like a <main> element is allowed to have div ancestors: https://html.spec.whatwg.org/multipage/grouping-content.html#hierarchically-correct-main-element https://html.spec.whatwg.org/multipage/grouping-content.html...
- Theodores 7y agoTrue, you can have as many divs as you want. But it can't be in a more sensible element and there is no good reason with today's CSS layout to want to put it in untold wrappers. Maybe it is a react thing where everything has to be in div wrappers. Anyway, if the spec matters more than the toolchain it should not be anywhere but directly under the body element.
- korm 7y agoThe comment you replied to points out that "main" can be inside a div according to the spec. Also, React doesn't require the wrappers.