Skip to content Skip to sidebar Skip to footer

Can't Change Body Background Color Using Css Reset

Here is my HTML code:

Solution 1:

change your selector to

html, body{
    background-color: #FF0000;
}

Solution 2:

brenjt's answer is correct, but I'll provide an explanation for what is wrong and why that solution works:

Your CSS reset file sets the background color of html which is the entire page. You are only setting the body's background color, but your body is extremely small in height since you have no content. Consequentially, you do not see the body's background color.

Just set both the html and body in CSS like this:

html, body { background-color: #FF0000; }

EDIT:

Had you not set the html background color, then body's background color would represent the whole page. But since you are using an external source's CSS reset, you do not have the option of not setting the html properties.

Post a Comment for "Can't Change Body Background Color Using Css Reset"