Wednesday, July 19, 2023

CSS Specificity

 

SelectorSpecificity ValueCalculation
p11
p.test111 + 10
p#demo1011 + 100
<p style="color: pink;">10001000
#demo100100
.test1010
p.test1.test2211 + 10 + 10
#navbar p#demo201100 + 1 + 100
*00 (the universal selector is ignored)

!important > inline css > id > class > element

0 comments:

Post a Comment