Inheritance and specificity

Cascade

The cascade in Cascading Style Sheets refer to how style rules are applied based on specificity and source order.

Syle sheets are read from top to bottom.

p {
    font-size: 12px; 
}
/* this syle will take precedence */

p {
    font-size: 18px; 
}

Higher specificity value styles takes precedencce regardless of the order.

Important keyword

p {
    font-size: 12px!important; 
}
Previous