Forums

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

Home Forums CSS Remove the last border right?

  • This topic is empty.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #44478

    I have set on my nav li a a border right how would I remove the very last border?

    #133590
    Paulie_D
    Member

    Use last:child

    #133594

    some thing like this #rightNav li a: last child {border-right: none

    #133595

    I did this #rightNav li a:last-child { border-right: 0px; } removed all

    #133596
    iknowdavehouse
    Participant

    Didn’t know about that @jamy_za, I use :last-child quite often… In the event you are doing a border-left and a border-right (one light one dark effect) and you didn’t want to use :last-child for the above reason you could manually give the last one a class of last and style that with border-right: 0px; too.

    #133597
    Paulie_D
    Member

    `border-right: none` should work.

    If not, try the solution given by @jamy_za

    #133598
    #133599
    Paulie_D
    Member

    this

    #rightNav a:last

    is not this

    #rightNav a:last-child

    #133600

    Go it working in code pen

    #133601
    Paulie_D
    Member

    In any case, in your Codepen you have added the border to the `li` not the `a` so it should be

    #rightNav li:last-child

    #133640
    TheDoc
    Member

    I agree with @jamy_za, I always use `first-child` for the extra browser support.

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