这是一个奇怪的。 http://www.madebypaz.com/profile上的<OL>使用:before伪元素作为图表的注释(ABC和图像)。我像这样使用相邻的兄弟选择器:

#profiletext ol li:before {
    content: 'A';
    }

#profiletext ol li+li:before {
    content: 'B';
    }

#profiletext ol li+li+li:before {
    content: 'C';
    }

#profiletext ol li+li+li+li:before {
    content: '';
    }

#profiletext ol li+li+li+li {
    background: url('/wp-content/themes/paz2010/images/sweet-spot.png') no-repeat;
    margin-left: 0;
    padding-left: 38px;
    }

#profiletext ol li {
    height: 30px;
    margin-left: 10px;
    }


这可能不是最优雅的解决方案,但是它在包括Chrome在内的所有浏览器中均能完美运行,直到有人向我指出它在Chrome 10中损坏。在Chrome 10中,它显示AAA并在鼠标悬停时更改为正确的字符。这很好奇,因为甚至没有定义:hover样式!

这是此内容的屏幕记录:http://cl.ly/0E170v1Z0O2E0f3F0j0d

为什么会这样,我该如何解决?有没有更好的方法来达到相同的结果?

任何指针,不胜感激!

最佳答案

这在Chrome 16上可以正常运行-需要进行简单更新。

关于css - Chrome 10中的相邻兄弟选择器和:before伪元素,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/5666961/

10-11 20:08
查看更多