日期:2014-05-17  浏览次数:20792 次

急!!background:none!important 这个是什么意思??
我在学习CSS的过程中,
遇到了下面的这种用法。
background:none!important

cursor: pointer !important;

想问一下各位高手,这是什么意思??


------解决方案--------------------
应该为的是IE7也会支持:background:none;和cursor:pointer
------解决方案--------------------
我觉得应该是,使用!important属性的样式,Firefox、Opera等浏览器才会识别他的优先级,而ie中不会识别!important的样式,也就是这两行代码,是过滤ie的吧,个人见解!
------解决方案--------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<style type="text/css">

 span{
visibility: hidden;
}
 a{
 background:url(http://img1.qq.com/lady/pics/12105/12105393.jpg) no-repeat left top;
 width:158px; height:200px;display:block; border:1px solid #FFFFFF; float:right;overflow:hidden;
 } 
 a:active,a:hover{ cursor:pointer}
a:hover span,a:active span{position:absolute;top:0px; z-index:20px; left:0px; visibility: visible;}
img{ width:400px; height:280px; border:7px solid #FFFFFF};
</style>
<body>
<a href="# "><span><img src="a2.jpg" alt="图片说明" /></span></a>

</body>
</html>
实例二:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<style type="text/css">

 span{
visibility: hidden;
}
 a{
 background:url(http://img1.qq.com/lady/pics/12105/12105393.jpg) no-repeat left top;
 width:158px; height:200px;display:block; border:1px solid #FFFFFF; float:right;overflow:hidden;
 } 
a:hover span,a:active span{position:absolute;top:0px; z-index:20px; left:0px; visibility: visible;}
img{ width:400px; height:280px; border:7px solid #FFFFFF};
</style>
<body>
<a href="# "><span><img src="a2.jpg" alt="图片说明" /></span></a>

</body>
</html>

发现只是少了一句: a:active,a:hover{ cursor:pointer};下面的效果就出不来了。

------解决方案--------------------
引用楼主 linlinbaobao 的帖子:
我在学习CSS的过程中,
遇到了下面的这种用法。
background:none!important

cursor: pointer !important;

想问一下各位高手,这是什么意思??