How do I select the last child of a div with only a certain name using only CSS?

Posted by Jared on Stack Overflow See other posts from Stack Overflow or by Jared
Published on 2010-03-17T15:45:25Z Indexed on 2010/03/17 15:51 UTC
Read the original article Hit count: 187

Filed under:

Hello,

I have been using the following CSS to apply an effect at the bottom of elements in a menu:

.leftMenuProductWrapper div:last-child{margin-bottom:20px;}

This works fine initially, however after adding more elements in the menu, I realized it was a problem. I really only want to select the last div with .leftMenuProductButton within .leftMenuProductWrapper

Anyway to do this without using Jquery, just pure CSS?

© Stack Overflow or respective owner

Related posts about css