正常工作,为什么文章的行为不同,以div的,其中最后一个孩子而言最后孩子没有与文章
HTML
<div class="parent">
<div class="example">111</div>
<div class="example">111</div>
<div class="example">111</div>
<div class="example">111</div>
</div>
<br>
<div class="parent2">
<article class="example">111</div>
<article class="example">111</div>
<article class="example">111</div>
<article class="example">111</div>
</div>
CSS
.parent .example{ background-color: red;}
.parent .example:last-child{background-color: yellow;}
.parent2 .example{ background-color: red;}
.parent2 .example:last-child{background-color: yellow;}
DEMO:http://jsfiddle.net/chLLa/1/
因为你使用div标签关闭您的文章标签?如果您修复这些错别字,似乎工作正常。 http://jsfiddle.net/j08691/chLLa/2/ – j08691
[Validators](http://validator.nu/)是你的朋友。 – steveax
好的 - 对不起...其实我在我的实际代码中仍然存在这个问题,所以我会试着重新编写它 – byronyasgur