Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
tr:nth-child(even) { background: #f8f9fa; } /* Zebra rows */ li:nth-child(3) { color: red; } /* 3rd item */ li:nth-child(-n+3) { font-weight: bold; } /* First 3 items */ li:nth-child(n+4) { display: none; } /* Hide after 3rd */ /* Every 3rd starting from 1st: 1, 4, 7, 10... */ li:nth-child(3n+1) { border-left: 3px solid blue; }
Result
Open