Forums

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

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #31767
    Meander365
    Member

    So I’ve set up a simple div as two column container. Something awesome like this:

    -moz-column-width: 190px;
    -webkit-column-width: 190px;
    -webkit-column-gap: 80px;
    -moz-column-gap: 80px;

    In the div are a number of sections.

    Anyone know how I can target the last section in the first column?

    Thanks!

    #58354
    Johnnyb
    Member

    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!

    #58352
    jamygolden
    Member

    @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.

    #58262
    Johnnyb
    Member

    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!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.