首页 > Web开发 > 详细

css选择器优先级

时间:2019-09-23 20:26:20      阅读:75      评论:0      收藏:0      [点我收藏+]

怎样覆盖!important?

第一种:

table td { height: 50px !important; }   // 优先级第三
.myTable td { height: 50px !important; }  // 优先级第二
#myTable td { height: 50px !important; }  // 优先级第一

第二种:

使用相同的选择器,但是置于已有的样式之后:

td { height: 50px !important; }

 

css选择器优先级

原文:https://www.cnblogs.com/xjy20170907/p/11574334.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!