我正在使用 CSS3 PIE为 IE8 及更早版本添加对 border-radius 的支持,它与 :first-child 选择器冲突。
基本上,我有三个列表项向左浮动。每个都有 10px 的左边距,除了第一个,我设置为 0:
#steps li { border-radius: 10px; float: left; margin-left: 10px; } #steps li:first-child { margin-left: 0; }
当我将 PIE 应用于 #steps li
选择器以添加对 border-radius 的支持时,第一个列表项被重新绘制,左边距设置回 10px,就像 #步骤 li:first-child
选择器不存在。我可以判断这是由于 PIE 重绘了元素,因为它在正确的位置短暂闪烁,然后在一瞬间移动了超过 10px。
我已经尝试将 PIE 应用于两个选择器,但这并没有什么区别,而且我在 PIE 支持论坛上找不到与第一个 child 有关的任何内容。
最佳答案
查看官方论坛 CSS3 PIE Forums - IE :first/last-child overwritten
最后的结果是你需要添加
#steps css3-container:first-child + li,
#steps li:first-child {
margin-left: 0;
}
关于internet-explorer - CSS3 PIE 与 :first-child 冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7651388/