1tr:nth-child(even) {background: #CCC}
2tr:nth-child(odd) {background: #FFF}
1/* Selects the second <li> element in a list */
2li:nth-child(2) {
3 color: lime;
4}
5
6/* Selects every fourth element
7 among any group of siblings */
8:nth-child(4n) {
9 color: lime;
10}
11
1:nth-child(3) { //the number is the child number you are targeting
2 //styles here
3}
1/*
2 Descendant selectors are used to match to any nested element.
3 Child combinators, on the other hand, only match to the direct
4 child element and are defined by the greater than symbol.
5 The selector on the right must be the direct child of the element
6 on the left.
7*/
8/* child combinator */
9 parent > child {...}
10
11/* descendant selector */
12 parent child {...}
13 ancestor descendant {...}
14