Class and ID declarations are HTML and used for purposes beyond CSS. They should be semantic. A good test is if you can swap out your style sheet and display a completely different design, without affecting the HTML.
1
It is semantic. Heading 2 size is not the same thing as <h2>. Wether you call it Heading 2 or Level 2 Heading or whatever, those are just different ways of describing visually the same thing.
1
1
In my world, .h2 .heading-2, or anything else describing a scale of type is doing exactly what you are talking about. .h2 !== <h2>. I'm not applying the semantics of one element to another, I'm describing one element as having the 2nd largest size a heading can have. Ya dig?
1
That’s a self conflicting answer. If the item can semantically be described as the second most important hierarchical header on the page, it belongs in an <h2> tag, ya dig?
2
Hierarchical size order and semantic order aren't always tied together. Size !== semantic importance.
2
1
6
Ok, I can appreciate that you weren’t trying to dismiss. Still, hierarchical size, when it’s separate from semantic order, describes presentation not content, and hence doesn’t belong in HTML. Code HTML for a screenreader. <h1 class=“h2”> doesn’t make semantic sense.
2
1
I would argue the exact opposite. It's much better for the screen readers <h1> says that this is the most important semantic element on the page. .h2 says it should be the size of "heading level 2".
2
2
Size shouldn’t be in HTML. What does size mean to a screen reader, when you’re saying it conflicts with the actual proper semantic order?
2
1
Web these days...maybe I’m too old school. CSSZengarden, WASP, ALA, etc. my heroes were/are @mholzschlag @meyerweb @mezzoblue to me, <h1 class=“h2”> is just wrong 🤷🏻♂️
1
2
"no semantic meaning" - I'm not raising a conflict here at all, forgive me, but semantics means meaning and h2 has meaning in hierarchical headings both for structure and also #a11y. Please no conflict on my thread, I make enough on my own ;-)
Jan 8, 2021 · 9:12 PM UTC
1
1


