4 ms·
> There’s a reason why the class attribute exists. You can also validly use custom elements and attributes To hammer this home - there is nothing bad about div
by madeofpalk 6y ago
> There’s a reason why the class attribute exists. You can also validly use custom elements and attributes
To hammer this home - there is nothing bad about divs when it comes to accessability which, to be honest, is the only concern that "semantic html" should be about.
- SippinLean 6y ago> there is nothing bad about divs when it comes to accessability [sic] There certainly is. Prefer h1 over div, button over div, etc whenever appropriate. https://www.w3.org/WAI/tips/developing/#use-mark-up-to-convey-meaning-and-structure https://www.w3.org/WAI/tips/developing/#use-mark-up-to-conve...
- madeofpalk 6y agoSorry, yes you're right. Use semantic elements when they are available. But otherwise, there's nothing wrong with divs. Assistive technologies mostly ignore them untill you give them meaning.