CSS背景图片在IE中无法显示?

3
在IE8及以下版本中,我正在执行以下操作
<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个回答

4

在Internet Explorer中,nth-child不被支持

我认为你需要手动对元素进行编号(即为它们添加指定正确着色的类)。


有人应该把那个表格发送给微软,并问问他们为什么这么慢。 - Kyle
公平地说,其他浏览器也有这个选择器的问题,而微软在IE9中也有这个问题。 - bobince
没错,我是在评论那张表格中 MS 名称下面的红色块的数量 :) - Kyle

3

不幸的是,IE不支持nth-child选择器。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接