Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

CSS - target last instance of div

CSS - target last instance of div

Problem

I have a div structure as below and i want to only target the last .Pcontain on the page so i can remove the border-right - how do i go about it?

Problem Courtesy of: Nikki Mather

Solution

Working Fiddle

Use last child

.postcontainer:last-child .pcontain{ 
    background: black;
    color: white;
}

Read more about last-child here

Solution courtesy of: What have you tried

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

CSS - target last instance of div

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×