Search code examples
cssyuibackground-colorcss-reset

background color disapears when i declare a doctype with YUI reset.css


When running in quirks mode, this works as expected however when I declare HTML 4.01 strict the background color disapears. If I remove the YUI reset.css, it seems to work as it should. Anyone know what YUI is doing?

I am using

 body{
      background-color:#000;
 }
 .wrap{
      width:60em;
      min-height:100%;
      position:absolute;
      top:0px;
      background:#666;
      left:50%;
      margin-left:-30em;
 }

The HTML:

anything


Solution

  • The reset is setting the background colour for html to white. Can't tell what's going in your HTML without seeing it, but the chances are the body is collapsed around the content. To get the desired black background you'll need:

    html{
          background-color:#000;
    }