shoots
클래스의 두 div가 있습니다. 첫 번째 div는 padding-top
이 10px이고 마지막 div는 padding-bottom
이 10px가되도록하고 싶습니다.: 첫 번째 자식 의사 클래스가 작동하지 않습니다.
이 경우 의사 클래스 선택자를 사용하려고합니다. :first-child
& :last-child
.
last-child
작동하지만 div의 맨 아래에 내 패딩이 있지만 first-child
이 작동하지 않습니다.
내가 뭘 잘못하고 있니?
마크까지 :
<div class="item-list">
<div class='item'>
<div class="shoots">
*content*
</div>
<div class="shoots">
*content*
</div>
</div>
</div>
CSS
.item-list .item .shoots:first-child
{
padding-top: 10px;
}
.item-list .item .shoots:last-child
{
padding-bottom: 10px;
}
어떤 브라우저를 사용하고 있습니까? – Interrobang
여기에서 작동 : http://jsfiddle.net/gBSyh/ 문제에 대한 추가 정보가 필요합니다. –
게시 한 코드가 의도 한대로 작동합니다. 테스트 사례를 확장하거나 문제가 두드러진 곳에서 링크를 제공하십시오./ –