5 ms·
The HTML in the report tells me as much about the state of CSS as what is in the report. Sure a lot of people know lots of clever CSS things, but are we over-c
by Theodores 7y ago
The HTML in the report tells me as much about the state of CSS as what is in the report.
Sure a lot of people know lots of clever CSS things, but are we over-complicating things and forgetting the basics of HTML?
This report does not use HTML properly. It is a sea of divs which is all well and good for CSS but not what this whole thing is ultimately about.
The document structure has a main element but this is in the wrong place. According to the HTML spec the main element should be directly below the body element with no extra div wrappers.
Then the page has one nav element. Beyond that it uses none of the sensible HTML5 elements for the content. Nothing is broken down into sections, articles and asides. Graphs are not in figures.
These elements are important, otherwise we might as well just give up and just post images with imagemaps.
Surely some content on the report must be a 'header' or part of what you might call a 'footer'?
I don't get this complacency when it comes to writing HTML, why everything always has to be in a div when the spec says you should only being divs when there are no better elements.
Since this report is entirely written in div soup with one nav element and one badly placed main, they don't know HTML so why should I take seriously what the report says about CSS? It is going to be the same cargo cult stuff.
- okbake 7y agoIt 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.
- douglaswlance 7y agoIt was built with React, so they don't really care about how the actual HTML elements are laid out.
- the_other 7y agoThat's no excuse. React has no opinions about which elements nest within which others. Since React 16, it doesn't even force unnecessary wrapper elements thanks to the inclusion of `React.fragment`.
- deleted 7y ago[deleted]