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}
1p:nth-child(2n+1){
2 background: #05ffb0;
3 border: 1px solid;
4 padding: 5px;
5}
6
7/* OR */
8p:nth-child(odd){
9 background: #05ffb0;
10 border: 1px solid;
11 padding: 5px;
12}