3 ms·
It is similar as with buttons (https://news.ycombinator.com/item?id=45774182 https://news.ycombinator.com/item?id=45774182). Not sure when it was (10-15 years
by stared 1y ago
It is similar as with buttons (https://news.ycombinator.com/item?id=45774182 https://news.ycombinator.com/item?id=45774182).
Not sure when it was (10-15 years ago), but at some point everything became <div>s. So, instead of semantic markup, HTML became a UI toolbox.
- macintux 1y agoI think it was inevitable. Most of the funded content on the web is marketing/sales-driven, and companies paying for marketing content want it to be displayed in a specific way. It’d be interesting to have a parallel DocBook web for technical content, where consumers of that content could apply their own styles to render it in a way that’s best for them.
- jazzypants 1y agoI mean, you can just remove all the user agent styles and then <button> is just as stylable as <div>.
- macintux 1y agoWhy would marketing want to pay for the extra (and to their mind entirely pointless) work required to capture semantics? (I’m not saying I like the world we live in, but I don’t see a likely alternative.)
- withinboredom 1y agoBecause not everyone has useful eyeballs. Some people are blind. The amount of extra work you have to do to make a div faithfully act like a button is far more than simply resetting some styles.
- macintux 1y agoIt seems evident to me that semantics are more challenging to define than visuals; it's not the CSS that's the problem.
- lwhi 1y agoIt's more challenging to encourage correct implementation of semantics than implemention of visuals; which is a great reason for using the element that was designed for this use case.
- mpeg 1y agoI've literally never had a marketing person tell me whether I should use a <button> or <div>. Let's not pretend things like using the wrong semantic elements is anyone else's fault but lazy or inexperienced developers. These days it's a moot point anyway, because everyone is using things like tailwind which provide a full reset for things like default buttons, so there really is no excuse.
- nonethewiser 1y agoThat's because the DOM is mostly used as a render target instead of a semantic document. I think semantic HTML is a great idea but it's kind of jaded to expect it at this point. It also doesn't help that semantic elements have styling. That right there gives people good reason to use a neutral container as a baseline. In fact I would go as far as to say that having both div and span is a bad design decision. They are just aliases for css `display` values.
- joquarky 1y agoThe semantic web never took off because companies don't want to make their content easy to scrape. Just look at how they salivate for WASM where everything is closed up and inaccessible, including a11y.
- cruffle_duffle 1y agoThat is one reason. Another reason is everybody’s way of organizing content is different. There would need to be an infinite set of semantic tags to really make it work.
- art0rz 1y agoI've been writing HTML for at least 20 years professionally and this has absolutely not been my experience. Yes, I've encountered some people using divs for everything but in the vast majority of cases people have used semantically correct HTML, at least when it comes to buttons.
- lelanthran 1y ago> Yes, I've encountered some people using divs for everything but in the vast majority of cases people have used semantically correct HTML, at least when it comes to buttons. I dunno; ISTR that the materializecss library used `<a>` for buttons.