0

我在 IE 7 和 8 中使用空跨度 css 图像替换技术时遇到问题。我的徽标(透明 png)丢失。我假设它与负文本缩进有关?在所有其他浏览器中完美运行。任何帮助将不胜感激!

<h1 class="logo grid_8"><a href="index.html">The Bandwagon<span></span></a></h1>

.grid_8 {text-indent:-1000em; margin:-30px 10px 0 0;}

.logo .grid_8 a{
position:relative;
display:block;
width: 470px;
height: 150px;
overflow:hidden;}

.grid_8 span {
display:block;
position:relative;
width:470px; 
height:150px;
background:url("../img/TBWlogo.png")no-repeat left top;
z-index:1000;}
4

1 回答 1

1

似乎在no-repeat中断 IE 之前缺少空间。尝试这个:

background:url("../img/TBWlogo.png") no-repeat left top;

选择器.logo .grid_8 a选择在 class下的a元素下的元素。根据您的标记,我认为您喜欢在具有两个类(和)的元素下选择一个元素。grid_8logoalogogrid_8

要选择具有多个类的元素,您需要删除此处的空格。

.logo.grid_8 a {}
于 2011-12-09T19:49:33.583 回答