6 ms·
Div Divisiveness
- dexwiz 5y agoI really have a hard time seeing semantic HTML catching on outside of big business where it’s audited and required for purchases. First modern CSS destroyed semantic styling. Selectors are written using mostly class names and there is not consistency between article or header from one site to the next. Even buttons are different. Even on a single page there are probably instances where styling by element is undesirable. Second, while there are plenty of tools out there to tell you that you have a11y errors, few developers see direct benefit to using semantic elements. Screen readers are difficult to use if you have spent a lifetime as a visual user and keyboard shortcuts still don’t seem to be there. Screen reader provide all sorts of nav options based on semantics, but visual mode users are usually stuck with Tab and maybe Arrows. Until visual users can clearly benefit from semantics, it will always be second class. Third, it’s confusing. Webdev is already a pile of gotchas and obtuse footguns. Semantic HTML is another set of knowledge that developers need to memorize and only get feedback about when using analysis plugins. You can test when a button does or does not work, but it’s harder to test if your semantic HTML is correct.
- madeofpalk 5y ago"Semantic HTML" is just a means to an end, which is creating websites that many people can use. Just make normal websites normally, and you'll get like 95% of the way there. Use button for buttons, links for links, etc. Actually put labels on form controls. The beauty of using HTML correctly is that everyone benefits from it.
- the_other 5y ago> Until visual users can clearly benefit from semantics, it will always be second class. Visual users clearly benefit from the semantics implied by visual styling. Space around content, borders, font changes, phrase-level changes like italics etc. These all layer subtlety, dimension, nuance and structure to a document/page/app. Visual users "get it for free". If you took away all those things, visual users would feel the loss of context just as non-visual users do. > modern CSS destroyed semantic styling. Modern CSS methods didn't "destroy" semantic styling. Any kind of styling refines or highlights the semantics of the content it applies to. The modern techniques have sped up feature development for the visual-user subset. You can still use modern techniques and apply them to headers, sections, buttons, nav controls and so on. Frankly, if you use the older CSS methods, you write less code to achieve most of the same goals.
- FactoryReboot 5y agoThe biggest use case for semantic html is accessibility imo. Given Aria tags are the main workhorse there, I say semantic html has failed to provide value there. Given all the html created via a component like pseudo element, it further questions the value added imo. Potentially unpopular opinion, but semantic HTML failed to adequately solve any problems it has set out to solve. Even selectors are better done via something like css modules anyway. Sure the end compiled HTML is a mess, but that’s like complaining your bytecode or binary is messy. Who cares? Long live div soup.
- brimble 5y agoSemantic tags would have been great if we'd left most or all styling up to browsers and user preference. Agreed that it's of dubious benefit if you can use other means to fix things like a11y (and, as you note, that's totally possible). The idea was probably a zombie as soon as browsers started moving user defined styling to less-prominent areas of the UI, which was a long time ago. [EDIT] I'd to add that for the specific but now-niche use case of writing HTML by hand (which, in an editor with good tag completion and auto-formatting, I find almost as fast as, and far more powerful than, Markdown) semantic tags can be really nice.
- 3825 5y agoCounterpoint, this is what bad people use div soup for: » Facebook adds 5 divs, 9 spans and 30 css classes to every single post in the timeline to make it more difficult to identify and block 'Sponsored' posts, oh my. Previously on hn, https://news.ycombinator.com/item?id=19115460 https://news.ycombinator.com/item?id=19115460
- echelon 5y agoA long term fix for that sort of nonsense is a process that runs separate from the rendering engine, whether in the browser or host OS, and uses computer vision and ML to identify blocks of advertising. A true win for the opposition would be to study the literature for ad jamming techniques that would turn people against the advertised content, and alter the ads to be long term subconsciously unappealing / damaging. (eg. "McDonalds McRoach Sandwich") Bonus points if it could unravel dark patterns, gamification, and engagement optimizations.
- ffhhj 5y agoI just moved from tables to this: .table { display: flex; } .table-vert { display: flex; flex-direction: column; } .cell-wide { flex-grow: 1; } Are you telling me there are other ways to create websites?
- i_like_apis 5y agoI for one welcome our new flexbox overloards. It's a bit heavy on classes and css, and quickly grows into something that is hard to restructure when needed, but I find myself banging my head against intractable problems less often. There is almost always a way to achieve what you want with flexbox.
- Newman20 5y ago[dead]
- mofosyne 5y agoWe can seperate styles from a page using CSS... Maybe we could try seperating the html template from the content as well?