星空网 > 软件开发 > 网页设计

css的!important用法介绍

css的!important用法介绍:
!important可以提升css语句的权重,下面就通过代码实例做一下简单介绍。
它有些浏览器兼容性问题,出在奇葩的IE6浏览器身上,不过问题不大,因为IE6的用户以后会越来越少直到绝迹。
代码如下:

<!DOCTYPE html><html><head><meta charset=" utf-8"><meta name="author" content="http://www.softwhy.com/" /><title>蚂蚁部落</title><style type="text/css">#antzone{ width:150px; height:100px; background-color:green!important;}#antzone{ background-color:blue;}</style> </head> <body> <div id="antzone"></div></body> </html>

上面的代码中,如果不使用!important话,那么背景颜色就是蓝色,因为后面的语句会覆盖前面的,但是如果使用!important就会提升响应语句的权重了,关于IE6的兼容性问题,可以参阅CSS的!important语法规则一章节。

原文地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=15084

更多内容可以参阅:http://www.softwhy.com/divcss/




原标题:css的!important用法介绍

关键词:CSS

CSS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

德国市场特征:https://www.goluckyvip.com/tag/13205.html
德国买家习惯:https://www.goluckyvip.com/tag/13206.html
欧美疫情:https://www.goluckyvip.com/tag/13207.html
疫情美国电商:https://www.goluckyvip.com/tag/13208.html
美国电商销量:https://www.goluckyvip.com/tag/13209.html
更好卖:https://www.goluckyvip.com/tag/1321.html
去日本入住酒店,东西随意用却有一个特殊“要:https://www.vstour.cn/a/411241.html
中国有哪些著名的酒店品牌。:https://www.vstour.cn/a/411242.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流