不知道怎么修好它。我尝试做不同的标识类型,这取决于标签的类别。html为:
<div id="header">
<a href="/index.php" id="logo" class="cet">
<h1 id="l">title</h1>
</a>
</div>css是:
#header {
height:204px;
background: url(../img/il-01.jpg) no-repeat 400px 2em;
position:relative;
clear:both;
}
#header #logo {
display:block;
position:absolute;
left:2em;
top:3em;
width:355px;
height:107px;
overflow:hidden;
}
#header #logo.cat { background: url( ../img/logo_cat.png) no-repeat -1px top; }
#header #logo.cet {background: url( ../img/logo_cet.png) no-repeat -10px -40px;}如果类被设置为“猫”,一切都很好,但是如果它被设置为“cet”,我就看不到IE6中的图像。在任何其他浏览器中,背景都可以正确显示。
背景图像的大小略有不同,这会是问题所在吗?
非常感谢您的回答
发布于 2010-09-23 22:46:40
background(-positon)不允许混合长度和关键字。旧的CSS版本不支持它,所以旧的浏览器可能不支持它。而不是
#header #logo.cat { background: url( ../img/logo_cat.png) no-repeat -1px top; }使用
#header #logo.cat { background: url( ../img/logo_cat.png) no-repeat -1px 0; }顺便说一句,你需要检查一下你的HTML。块元素(如<h1> )不能在链接(<a>)内。
https://stackoverflow.com/questions/3779551
复制相似问题