The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › Target Last Item in a Column
So I’ve set up a simple div as two column container. Something awesome like this:
In the div are a number of sections.
Anyone know how I can target the last section in the first column?
If you’re using jquery you could use something like: $(‘#column-1 .section:last’).css(‘background’, ‘orange’);
That would look inside of column-1 and find the last element with a class name of ‘section’ and change it’s background to orange! Which just happens to be the best color!
@Johnnyb That would work if it wasn’t a CSS3 column.
@Meander365 I think you’re going to have to do a bunch of tests yourself as CSS3 columns aren’t widely used.
Good point, it appears I was half asleep when I wrote that and didn’t pay much attention to the first half of the post!