To me it just seems like an extra step. If I have to add the class in the HTML element anyway, just like I would with the color style, what’s the point?
You can then use those same styles just by adding a class attributes to different HTML elements.
Even if you don’t plan on using multiple styles for a class, it makes it much easier to change the style in one place vs. looking for a lot of inline styles scattered throughout your page (or pages even).
Got it, thank you. I was thinking of a class only in terms of color, but that makes sense and now seems obvious that you can use multiple styles for one class.
Also you normally don’t have one element, you normally have tens or hundreds of elements. So, crude example, but you go from this, which is unmaintainable:
<p style="color: red">Some text.</p>
<p style="color: red">Some more text.</p>
<p style="color: red">Some text somewhere else.</p>
<p style="color: red">Some more text.</p>
<p style="color: red">Text.</p>
<p style="color: red">Some more text.</p>
<p style="color: red">Some other text.</p>