2012-02-16 2 views
1

클래스 widget-area가있는 div가 세 개 있습니다. 아래 CSS는 세 번째 위젯 영역입니다. 아래의 코드는 무엇을 의미합니까?CSS 연결

<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

즉시 후 2 .widget-area -s를 오는 .widget-area를 선택하는 supplementary.three에 포함되는 모든 (즉, 세 번째, 네 번째, 다섯 번째 등 .widget-areassupplementary.three에 포함된다). 명확한 소스 예제를 볼 때 선택자를 #supplementary.three #third.widget-area으로 다시 작성하는 것이 좋습니다.

margin-right:0은 세 번째 (네 번째, 다섯 번째 등이있을 경우) .widget-area의 오른쪽 여백이 없어야 함을 의미합니다.

관련 문제