2011-04-14 59 views
1

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

#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 10在Chrome中它在所有浏览器完美工作包括Chrome 10它会显示AAA并在您将鼠标悬停时更改为正确的字符。这很奇怪,因为甚至没有定义悬停样式!

下面是这个屏幕记录:http://cl.ly/0E170v1Z0O2E0f3F0j0d

为什么发生这种情况,我该如何解决?有没有更好的方法来达到相同的结果?

任何指针非常感谢!

+0

听起来像一个Chrome 10的bug。 – BoltClock 2011-04-14 17:13:57

+0

我遇到过类似的问题;也仅限于chrome,但是作为'〜'和':before'选择器之间的交互。 – 2011-05-19 15:46:21

回答

0

这在Chrome 16上按预期工作 - 需要进行简单更新。

+0

糟糕,看起来像您已经制定了解决方法,而不是上面引用的代码。 – 2011-12-12 16:51:10