3 ms·
> The reason we need semantics in HTML is to make the markup accessible for screen-readers Not sure about the screen-readers but when you add a class for, say,
by egeozcan 10y ago
> The reason we need semantics in HTML is to make the markup accessible for screen-readers
Not sure about the screen-readers but when you add a class for, say, "small", it's a bit confusing because you can't guess how it is used when looking from the CSS side. One day, you decide to represent the unimportant text as grey (bad idea) and then you need to find all instances of .small that are used for the unimportant content and change them to .grey (then you discover there already is a class named gray, oh the horror) whereas if you used .unimportant as a class name, your change would be a single line of CSS. Also, "h1 .unimportant { color: something-not-grey }" is way clearer than ".bold.big .small { color: something-not-grey }".