In my CSS file, I have defined two styles for a table with the class "myTable". The first style sets the background color of header cells to gray, while the second style sets the background color of odd rows to blue:
.myTable th
{
background-color: gray;
}
.myTable tr:nth-child(odd)
{
background-color: blue;
}
However, when I view the page, the headers are displaying in gray instead of blue. I am confused as to why the first rule is taking precedence over the second one. As far as I understand specificity calculations, the second rule should be more specific. Can someone please help me understand why the headers are not displaying in blue as expected? Thank you for your assistance.