2012-02-16 69 views
1

我有三个具有类小部件区域的div,下面的CSS用于第三个小部件区域。 下面的代码是什么意思?CSS concatenation

<div id="supplementary" class="three"> 
    <div class="widget-area" id="first"></div> 
    <div class="widget-area" id="second"></div> 
    <div class="widget-area" id="third"></div> 
</div> 

CSS:

#supplementary.three .widget-area + .widget-area + .widget-area 
{ 
    margin-right: 0; 
} 

能有人在那里帮助我吗?

回答

1

http://www.w3.org/TR/CSS2/selector.html#adjacent-selectors

它选择.widget-area,附带2个.widget-area后立即-s,所有包含在supplementary.three(即,第三,第四,第五等.widget-areas包含在supplementary.three)。给出你的澄清的源代码示例,最好将选择器重写为#supplementary.three #third.widget-area

margin-right:0意味着不应该有第三个(如果有的话,第四个,第五个等).widget-area的权利保证金。