menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

Understand...
source image

Medium

1w

read

38

img
dot

Understanding HTML and CSS Specificity (In My Own Words)..

  • Specificity is a concept in CSS that determines which rule takes precedence when there are conflicting styles for the same element.
  • CSS uses a scoring system where the more specific a selector is, the higher its score and the rule with the higher score wins.
  • The specificity hierarchy in CSS is: inline styles > IDs > classes/attributes > elements.
  • In case of a tie, the rule that appears later in the CSS file wins, and the !important declaration overrides almost every other rule.

Read Full Article

like

2 Likes

For uninterrupted reading, download the app