Explore 100's Of Free Video Tutorials

Keep Learning, Keep Coding & Keep Sharing

CSS

CSS Specificity - Part 1

Notes:

CSS Specificity - Part 1:
What happens when we define set of style rules for a specific tag in external, internal as well as inline styles?

The answer is: “rules get’s cascade”

The rules of the cascade include:

More specific selector’s properties override less specific selector’s properties.
Nearest properties override farthest properties, when specificity is equivalent.
Finally for every tag a virtual declaration list is created by combining all properties from all selectors

Interview Questions: