by baobun · 11mo ago · 0 comments
To figure out where styles come from, open Developer Tools in your browser and Inspect Element. You shoud see the HTML DOM element highlighted and its styles and where they come from on the right.
In this case the alternating font colors aren't from CSS at all.
If you look in the DOM tree / source like I proposed, you see that the list is already a table, so you can use that exact approach you already mentioned.
table tr:nth-child(odd) td.rank{
color: red;
}
table tr:nth-child(even) td.rank{
color: green;
}
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/S...