.someclass:last-child {
border-top: 1px solid blue
}
This doesn’t:
#myform .someclass:last-child {
border-top: 1px solid blue
}
I have a form consisting of a number of divs with a class of “someclass”. I’d like to style the last div, but for some reason it’s not working (no border appears).
Yes, we can’t tell why it’s not working without seeing the HTML. If the last .someclass div is lot the last child of the element with the #myform ID, then it won’t be targeted.
I ended up having to wrap all of my “someclass” divs in another div, otherwise the border would not appear because of the input tag to submit the form. So, problem solved.