p {color:red;} /*权值为1*/
p span {color:red;} /*权值为1+1=2*/
.warning {color:red;} /*权值为10*/
p span.warning {color:red;} /*权值为1+1+10=12*/
#footer .note p {color:red;} /*权值为100+10+1=111*/
最高权重!important,在结尾添加即可
CSS选择器的权重
于 2022-08-10 10:35:23 首次发布