2010-04-16 78 views
2

在IE8及以下,我这样做是在IE中不显示CSS背景图片?

<ul class="dependants_list" style="border-bottom: dashed 1px #53a1dc"> 

    <li class="dependants_summary"> 
    <strong>Name:</strong> De Silva, Angelina<br /> 
    <strong>Gender:</strong> Female<br /> 
    <strong>Date of birth:</strong> 7/3/2009<br /> 
    </li> 
    <form action="/Dependant/Delete/11413" method="get"><input class="delete btn" id="Delete_this_Profile" name="Delete_this_Profile" type="submit" value="Delete this Profile" /> 
    </form><form action="/Dependant/Edit/11413" method="get"><input class="edit btn" id="Modify_this_Profile" name="Modify_this_Profile" type="submit" value="Modify this Profile" /> 
    </form><br /><hr style="display:none" /> 

,并为它的CSS是:

.dependants_summary 
{ 
    overflow: hidden; 
    margin-bottom: 10px; 
    padding-right: 0px; 
    padding-left: 85px; 
    padding-top: 5px; 
    padding-bottom: 5px; 
    width: 430px; 
    float: left; 
    font: 120% Arial, Helvetica, sans-serif; 
} 
.dependants_list 
{ 
    padding: 0; 
} 
.dependants_list li:nth-child(odd) { 
    background: #fff url("../images/dependant_male.png") no-repeat scroll 8px 9px; 
} 
.dependants_list li:nth-child(even) { 
    background: #c9e3f4 url("../images/dependant_male.png") no-repeat scroll 8px 9px; 
}

的图像不被显示在IE浏览器,但他们在ffox和chrome

回答

2
在Internet Explorer中,

第n个孩子是not supported at all

我想你不会得到周围手动编号的元素(即添加类他们指定正确的色彩。)

+0

应该有人该表发送到MS,问他们为什么这么慢。 – Kyle 2010-04-16 12:45:49

+0

公平地说,其他浏览器也有这个选择器的问题,MS也在IE9中使用它。 – bobince 2010-04-16 12:56:42

+0

的确如此,我在评论该表中MS名称下的红色块的数量:) – Kyle 2010-04-16 13:02:23

2

不支持IE的子选择器不幸的是