Question

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

Was it helpful?

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;
}

OTHER TIPS

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

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top