3 ms·
<div class="block text-black">...</div> <div style="display: block; color: black;">...</div> Looks like the same thing to me. Only shorter.
by matheusmoreira 3y ago
<div class="block text-black">...</div>
<div style="display: block; color: black;">...</div>
Looks like the same thing to me. Only shorter.
- Akronymus 3y agoWith traditional css you'd most likely have a class for all the relevant attributes. <style> .someClass { display: block; color: black; } </style> <div class="someClass">...</div>
- matheusmoreira 3y agoOf course. That's how I learned CSS and how I wrote the CSS for my site. Apparently that's not how things are done these days. People have one class for every property and value combination now and essentially write the entire class inside the class="..." attribute. Can't understand why.
- culi 3y agoLike I said. It's not at all the same thing. Inline styles have different behavior from class-based styling