3 ms·
There's logic in CSS. Selector specificity, cascade, inheritance, display types, etc. Once you grasp the few parts that requires understanding you only need to
by Raphmedia 8y ago
There's logic in CSS. Selector specificity, cascade, inheritance, display types, etc.
Once you grasp the few parts that requires understanding you only need to remember the syntax and the declarations.
Then the real challenge is to organize your stylesheets in such as way that allows your styles to grow.
I've seen from experience that most people don't even try to learn the language. They come in with no knowledge of the cascade, wonder why everything fails and blame it on the language. Most "bugs" related to CSS can be spotted and fixed in minutes.
Ex: ID selectors are always stronger than classes when it comes to selector specificity. A class can also be mixed with an element selector to increase its weight but it will never beat an ID. Someone who is not aware of this will try to have a class selector be stronger than an ID and get strange results. Instead of fixing the selectors they put an !important on the class selector to have it be stronger than the ID. The stylesheet then quickly become a mess.
- sizzle 8y agoOr !important; everywhere