The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › CSS Question
Hi.
my second through to fourth-child is not picking up color difference
http://codepen.io/mwbcomputers/pen/ysHJq
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; }
Ok Will give it a go just teaching my self more on those things now makes life easier.