KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm trying to stripe the colours of alternating elements. But I want the row colors to alternate only the visible rows. If you have a look at the below here is my attempt at trying to get it working. http://jsfiddle.net/kuwFp/3/ <!DOCTYPE html> <html> <head> <style> p:not(.hide):nth-child(odd) { background:#ff0000; } p:not(.hide):nth-child(even) { background:#0000ff; } .hide { display:none; } </style> </head> <body> <p>The first paragraph.</p> <p class="hide">The second paragraph.</p> <p>The third paragraph.</p> </body> </html>
Tags (comma-separated)
Save Edits
Cancel