[SOLVED]How come the Background color won't work when I add it to the html, body {?

I forgot to add a semicolon.

Why does the below code have to be separate from the rest of the code in order for it to work?

   body {
        background-color: lightblue;
    }

If I put the background color in here it doesn’t work.

html, body {
margin:0;
padding:0

It doesn’t. You missed the semi-colon off the end of the very first CSS rule

This works just fine - I commented your last rule out btw.

html, body {
margin:0;
padding:0;
background-color: lightblue;
}
1 Like

I forgot to add a semicolon. yes.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.