|
|
|
|
|
by locallost
940 days ago
|
|
Which is better or correct is a question of basically how do you organize code. It's not irrelevant, but at the core should've been how to style content in a way that people actually want to style content. Instead a lot of time was spent on making up rules about cascading and specificity, which the vast majority of developers don't truly know. I knew them 15 years ago well, and realized also in horror as I wrote that I don't really know them so well. And turns out it's not so important. CSS gave us a bunch of primitive things to do, and we were supposed to figure it out, but the primitive things were not that well designed either. It was always a bunch of trickery, but at least the separation of concerns was taken care of. |
|
In other cases one can look up how it values id selector for example, or watch the immediate result in the browser, as one adds such a selector.
I am guessing, that over time people, who deal a lot with CSS, will learn the specificity rules automatically.