Search code examples
htmlcssyuicss-reset

can't change body background color using CSS reset


Here is my HTML code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>Hover Zoom</title>
        <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.3.0/build/cssreset/reset-min.css">
        <link rel="stylesheet" type="text/css" href="style.css">
        <meta http-equiv="content-type" content="text/html;charset=UTF-8" >
    </head>
    <body>

    </body>
</html>

Here is my CSS file code (style.css):

body {
    background-color: #FF0000;
}

but the background color of body does not change.

Without the CSS reset, it works fine. Can you suggest me a better CSS reset, or any other solution?


Solution

  • change your selector to

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