CSS is relatively easy to learn, but things might get messy and confusing if you skip the basics. In some cases, you may scratch your head trying to change an element's styling to no avail.
After looking at everything, and your code appears to be just alright, the most likely reason for such a behavior is the CSS cascade, which we defined in detail here.
CSS specificity is part of the cascade, which is key in determining an element's styling.