last-child css在chrome中无法正常工作?

时间:2011-03-01 01:50:48

标签: css css-selectors

此问题仅存在于Chrome中,在IE / FF中运行良好...

示例:http://www.8wayrun.com/media/algol-killer-combos.621/

在右侧,您将看到“人物”的列表,并在其下方:algol nightmare siegfried。这实际上是一个内联无序列表,具有以下参数:

.mediaDetails li::after {
    content: ',';
}
.mediaDetails li:last-child::after {
    content: '';
}

在IE / FF中这很好用,你最终得到一个看起来像“algol,nightmare,siegfried”的列表。然而,在Chrome中它看起来像“algol,噩梦,siegfried”;在最后一个孩子之后有一个逗号,不应该有。奇怪的是,如果我突出siegfried,逗号就会消失;如果我打开Chrome Inspector,逗号就会消失。

我的代码中是否存在导致此问题的错误?

1 个答案:

答案 0 :(得分:1)

嗯,这对我来说很好看:

enter image description here

我正在使用Google Chrome 10.0.648.119 BETA(我预计在稳定版本中也会出现相同情况)。