Spunky Posted May 8, 2017 Share Posted May 8, 2017 Real simple here: Why does this work.. tr.retired td:not(:nth-child(2)){ background-color:purple; } And this works... tr.retired td:not(:nth-child(3)){ background-color:purple; } But this doesn't work? tr.retired td:not(:nth-child(2)),tr.retired td:not(:nth-child(3)){ background-color:purple; } Fiddle: https://jsfiddle.net/m6z1suyb/ Thanks! Link to comment Share on other sites More sharing options...
dsonesuk Posted May 8, 2017 Share Posted May 8, 2017 They override each other so both take effect. I think you are looking for tr.retired td:not(:nth-child(2)):not(:nth-child(3)){ background-color:purple; } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now