Hacker News new | ask | show | jobs
by okbake 2555 days ago
It looks like a <main> element is allowed to have div ancestors: https://html.spec.whatwg.org/multipage/grouping-content.html...
1 comments

True, 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.

The comment you replied to points out that "main" can be inside a div according to the spec.

Also, React doesn't require the wrappers.