Is it right code?

li:nth-child(2){
color:red;
background-color: black;
}

no, unless you receive an error