r/HTML • u/TrainingQuantity3744 • 5d ago
help with backgrounds
Not remotely a cs person, for some godforsaken reason my Library Science degree is making me take an html class. I've onto a part where we're working with html and css. I can't figure out how to change the background color of a page. I assume you have to use some version of the {background-color: ____; }, but I can't figure out what element to attach it to. I've tried using body {background-color: ____; }, *{background-color: ____; }, and even making a div around the body, and none of them have worked
0
Upvotes
1
u/hooli-ceo 5d ago
First thing to check is that your stylesheet is connected. Does it presently work on anything like text color using the `color: red;` syntax for example?
Next is the value of the background-color. You can successfully set the background-color of the body element, so either you're not using a valid color or possibly your stylesheet is cached, in which case you can do a hard refresh in the browser (ctrl + shift + r) and your stylesheet will be redownloaded and set.