Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you look at the source for that example, he actually has 2 selectors that set an item to red, corresponding to the 3rd item in a group of 5 and the 7th item in a group of 9 (Formatted here for legibility):

    span:nth-child(3):nth-last-child(3){
        background-color:red !important;
    }

    span:nth-child(7):nth-last-child(3){
        background-color:red !important;
    }
That threw me for a bit of a loop too. "Wait, is that second item supposed to be red?" It would be clearer if the example and the demo matched up.


Thanks for the feedback -- that wasn't clear and I'll update the example and text to be clearer.


There's a typo too, 'adjacant' for 'adjacent'. I spent a moment wondering what adjacant meant.


Thanks, that's also fixed.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: