HTML and CSS Reference
In-Depth Information
Specificity guidelines
As shown in this chapter, the style of an element can be specified in many different places
and with different priorities. The cascading feature gives a lot of flexibility to CSS, but it
can also result in unnecessary complexity if not managed well.
In general, you want to keep specificity low to make it easier to know which rules
will take precedence. This way, you can allow the cascade to work for you by adjusting
the order in which your style rules appear, instead of needlessly increasing the specificity
with id and !important to override conflicting styles.
 
Search WWH ::




Custom Search