CSS Command Problem - What is the Real Logic?
source link: https://www.codesd.com/item/css-command-problem-what-is-the-real-logic.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
CSS Command Problem - What is the Real Logic?
I'm reading and experimenting about CSS lately, however, I'm having this same issue over and over in almost every experimentation I'm doing.
The problem is simply as follows: I set properties as a general rule. Then I try to modify those properties for single-items or sometimes a completely new class. For some reason, the old (initial rule) is still present and the new class is not affecting anything.
I know that the use of !important helps in these situations, but I'm still having difficulties to get the overall logic. Sometimes it works without !important, sometimes it just.. does not.
What am I missing ?
Here is an example where the "nomargins" class is not working unless it is applied as !important. http://cssdeck.com/labs/9xevau8p
You should look into specificity. Example
Your problem is that #main li
is more specific than .nomargins
.
If you want, you can add specificity to .nomargins
like this #main .nomargins
.
Related Articles
What is the real advantage of using external css and js in terms of page loading speed?
Docker: What is the real value for our team?
What is the real advantage of creating a site compatible with a pixel cross browser for anyone?
What is the real point of the pointers?
What are the real challenges for a developer migrating between programming languages?
What are the real-time applications of the `volati volati const?
What are the real benefits of using blocks in Objective-C?
What are the REAL steps to install SQL Server Express 2008 and Management Studio Express?
In the image processing, what is the real time?
What is the real meaning of the separation of content and presentation?
What is the best logic to return TRUE in VBA if month NAMES are separated?
What is the design logic behind Fragments as internal static classes in relation to autonomous public classes?
rsync: --include-from vs. --exclude-what is the real difference?
CSS background-image - What is the correct use?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK