문제

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

도움이 되었습니까?

해결책

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

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top