Dymond
Dymond

Reputation: 2277

element:last-child effects all the element and not only last

Im trying to remove border-bottom from the last element, but it affect all the elements.

This is what I have for now.

HTML

 <div class="cv-content">
    </div>

    <div class="cv-content">
    </div>

CSS

 .cv-content{
    width:400px;
    float:left;
    border-bottom:1px solid #ccc;
}       

.cv-content:last-child{
        border-bottom:0px solid #ccc;
}   

http://jsfiddle.net/FcCWG/

Upvotes: 0

Views: 288

Answers (1)

Explosion Pills
Explosion Pills

Reputation: 191749

Every .cv-content is the :last-child of .cv-item. Use .cv-item instead:

.cv-item:last-child .cv-content {

http://jsfiddle.net/FcCWG/1/

Upvotes: 3

Related Questions