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

801 Views Asked by At

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

3

There are 3 best solutions below

0
FinnNk On BEST ANSWER

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;
}
0
easement On

Are you declaring the style AFTER you include reset.css? If not, you could be resetting your changes.

0
BaronVonKaneHoffen On

Yep. Deleting the background rule from html { } in the YUI CSS reset sorts it. Thanks! Not sure why they put it there in the first place tbh.

Interestingly enough, doing this makes most (all?) browsers give full height to body as well, so even a repeating background set there will render over the whole page.