html - When to use element.style selector in css? -
this question has answer here:
the following list of selector types increasing specificity:
- universal selectors (i.e., *).
- type selectors (e.g., h1) , pseudo-elements (e.g., :before).
- class selectors (e.g., .example), attributes selectors (e.g., >>[type="radio"]) , pseudo-classes (e.g., :hover).
- id selectors (e.g., #example).
in addition above selectors, there default selector called,
when prefer using selector?
how css specificity rule applies selector?
here's specificity value
selector specificity specificity in large base inline-style 1 0 0 0 1000 id selector 0 1 0 0 100 class,pseudo,attribute selector 0 0 1 0 10 type selector , pseudo elements 0 0 0 1 1
copied this answer question specificity answered here.
Comments
Post a Comment