7 ms·
He wasn't arguing against <div> elements. He was arguing against using wrong elements. <div> is fine for layouts. It's not fine for labels.
by rob_mccann 13y ago
He wasn't arguing against <div> elements. He was arguing against using wrong elements.
<div> is fine for layouts. It's not fine for labels.
- roel_v 13y agoOK let's say that he's saying that, but then what does that mean? Don't use <div class="para">, but use <p> ? That's about it, then. He rages against 'painting with tags', but then what is 5 nested divs? It certainly doesn't add any semantic meaning, not in the way they are being used in the website. My passive-aggressive point is that 'semantic html' is an academic concept with a peak in popularity amongst the web dev plebs around 2000 and an occasional flare-up of interest from new-ish developers who re-discover the fundamentals. CSS has failed to make add the 'presentation layer' on top of semantic html as we once thought it would. It's simply not powerful enough. For the dream of real semantic html to come true, CSS should be able to 'implicitly' add elements to the content to apply styling to, so that we can 'add' a div around the body content in order to center it on the page, to name one use case. The cold reality is that nobody cares enough. Just toss in a few divs, use simple tech like html and css to make it look good, send the invoice, go home. Let the Googles of the world care about machine-readable semantics (because that's what we're talking about here - 'semantic html' is BS from a human's point of view, a human wants to have semantics through styling, not separate from it!). The continual references to 'assistive techology' in the post are especially laughable. Yes yes it's nice that blind people can use the web. Just as it is nice that people in a wheelchair can access buildings. I'm all for that, and I'd love to see more tech that allows people with bodies that function differently from those of the majority of people lead better lives. But arguing for 'semantic html' in that context is fighting wind mills and displays a gross lack of pragmatism. Let's spend our time on things that make the world better, rather than on talking about ways that would make the world better if only everybody in the world changed their behavior.
- rob_mccann 13y agoCreating complex animations and graphics is what he's talking about when he says 'painting with tags'. Things that canvas and SVG were designed to do. It's not hard to make good quality, semantic html. It makes code more readable for the next developer, better for SEO etc. You can use :before and :after to implicitly create elements. Sometimes needs-must and we have to throw in divs and poor-quality markup (mostly thanks to old IE), but there's no reason for it to be the default standpoint if it takes the same amount of time.
- roel_v 13y ago"It's not hard to make good quality, semantic html." :-O Seriously? Please show me the site that does so, and still looks OK (or even OK-ish) by moderns standards? "Sometimes needs-must and we have to throw in divs and poor-quality markup (mostly thanks to old IE)" Look, I take it you are a web dev, am I right? If so, how can you say something like this? Please link me to the last 5 or so sites you made, and tell me which div's and span's you only put in to support old IE versions. Every real site out there today uses div's and span's in non-semantic ways. That was the whole point of my post - :before and :after don't cut it. CSS just isn't powerful enough to make real semantic html happen. It's not a value judgement, it's just stating the blindingly obvious. The fact that the GP's blog post, complaining about this, starts with not one, not two, but five non-semantic div's is a painful manifestation of this.
- rob_mccann 13y agoYou're confusing semantic markup for using <divs> for layout. In < IE8 there's loads of <div class="clearfix"> around because display:inline-block wasn't supported.
- roel_v 13y agoUsing divs for layout is directly contrary to semantic markup. I wasted a whole paragraph on this in another reply in this thread so I'm not going to rehash that here, but this whole 'oh but it is semantic as long as it's only divs being used for layout' is self-delusion, white-washing and plain sophistry to resolve the cognitive dissonance between 'semantic html is what good devs do', 'I'm a good dev', and 'fuck me, it's impossible to do what I want visually without adding non-semantic tags'. Why don't we just call a spade a spade - real semantic html is impossible for the vast majority of real-world use cases, and all we're left with is trying not to fuck it up even more by using <div class="p">. Which brings us into, as I called it elsewhere, 'duh' territory.
- IanCal 13y ago> The continual references to 'assistive techology' in the post are especially laughable. Yes yes it's nice that blind people can use the web. Just as it is nice that people in a wheelchair can access buildings. It's also a legal requirement in the UK for both of those things. > Just toss in a few divs, use simple tech like html and css to make it look good, send the invoice, go home. Just whack in some stairs, nobody cares about the person in a wheelchair stuck at the bottom because it'd have taken longer to do things properly. Accessibility is hard, let's go shopping! > The continual references to 'assistive techology' in the post are especially laughable. Would you say that to someone struggling to read your site because you didn't take the time to use the right tags? > rather than on talking about ways that would make the world better if only everybody in the world changed their behavior. Screenreaders already exist, making your website accessible improves things even if nobody else does it. I suppose I'm just confused at your anger over the suggestion that you use p for paragraphs, actually add labels to forms, use em for emphasis, section for sections and h1-h6 for headings. Is it really that hard?
- roel_v 13y ago"I suppose I'm just confused at your anger" Oh I'm not angry, that's just my way of talking. You should meet me in person some time, it's fun, really ;) "over the suggestion that you use p for paragraphs, actually add labels to forms, use em for emphasis, section for sections and h1-h6 for headings. Is it really that hard?" Oh no it's not, and everybody should do it. That's not what the 'semantic web' or 'semantic html' is though. But if he's going to talk about grandiose subjects like 'semantic html', then the discussion is about that, and 'semantic html' is dead and buried. If he just wants to say 'use p/label/em/hx appropriately', then just say so, don't bury it under pseudo-philosophical waxing (but then again, his post wouldn't have made HN, so as it is, mission accomplished, right?)
- IanCal 13y ago> That's not what the 'semantic web' or 'semantic html' is though Semantic web != semantic html. Maybe that's the source of the problem here. The article says absolutely nothing about the semantic web. Semantic html is absolutely about using tags correctly.