1.最高优先级是 (直接在标签中的设置样式) <div style="color:Red;"></div>
2.次优先级是(ID选择器 ,假设级别为100) #myDiv{color:Red;}
3.其次优先级是(类选择器,假设级别为10) .divClass{color:Red;}
4.最后优先级是 (标签选择器,假设级别是1) div{color:Red;}
Post
Cancel
选择器的优先级
This post is licensed under
CC BY 4.0
by the author.