Forums

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

Home Forums CSS CSS Question

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

    Hi.

    my second through to fourth-child is not picking up color difference

    http://codepen.io/mwbcomputers/pen/ysHJq

    #141788
    pixelgrid
    Participant

    the pseudo selectors you can use based on position are

    :first-child
    :last-child
    :nth-child(number) //nth-child(2) for the second :nth-child(2n) for even childs 0,2,4

    your code should look like this

    .breadcrumb a:first-child {
    color: black;
    }
    .breadcrumb a:nth-child(2) {
    color: orange;
    }
    .breadcrumb a:nth-child(3) {
    color: red;
    }
    .breadcrumb a:last-child {
    color: yellow;
    }

    #141774

    Ok Will give it a go just teaching my self more on those things now makes life easier.

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