2013-08-27 125 views
1

我有這樣的事情:只選擇一個元素的第二個孩子與CSS

<div id="someID"> 
    <div class="text"> 
    -----other html tags 
    </div> 
    <div class="text"> 
     -----other html tags 
    </div> 
    <div class="text"> 
    -----other html tags 
    </div> 
</div> 

而一些CSS文本股利。有可能爲第二個div的文本類設置不同的CSS?

+1

是'#someID的所有孩子「會有同班? – BoltClock

+0

http://css-tricks.com/how-nth-child-works/ –

+0

@BoltClock是的。 –

回答

1

您可以使用僞選擇第n個孩子即div.text:nth-child(2)

相關問題