Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End border none last-child not working in php dynamic list

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #44905
    botpro7
    Member

    hi guys, i’m trying to rid border bottom from the last div of php dynamic list. Any suggestion to make this work?

    These are the [codes](http://codepen.io/botpro7/pen/JuEdp “codes”)

    Thanks in advanced.

    #135663
    TheDoc
    Member

    For starters, `#contentWrapper:last-child` shouldn’t work because that’s an ID and there should only be one of those on the page. Update that to use a class instead.

    Next: Codepen doesn’t work with PHP, since it doesn’t have access to your database. Copy/paste into Codepen what your PHP outputs.

    **Edit:** I’ve done it for you: http://codepen.io/ggilmore/pen/ba9759aa592893b3490302a548df28de

    So it’s working fine.

    You likely have another bit of code after the last contentWrapper that is causing last-child to target that instead.

    #135732
    jimmy
    Participant

    If the div you want to target is the last div in the given parent, you could use :last-of-type instead of :last-child.
    Even if there’s something following your list, it won’t interfere then (unless it’s a div of course).

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