开发者

No body-background-image with DOCTYPE

The body-Tag of a HTML-File does have a开发者_StackOverflow社区 background-image applied:

body {… background: #fff url(./img/bg-body.jpg) no-repeat 0 82; …}

everything works just fine with WebKit (Safari, Chrome…) and even Trident (IE) … BUT the background-image is not showing in Gecko (Firefox) … and if I add the DOCTYPE to the document, it doesn't work anywhere.

<html>
    <head>
        <style type="text/css">
            body {… background: #fff url(./img/bg-body.jpg) no-repeat 0 82; …}
        </style>
    </head>
    <body>
        …
    </body>
</html>

It does also not work with no divs, no content, no nothing…

Any ideas?


You need to specify the unit for your background position

body{ background: #fff url(./img/bg-body.jpg) no-repeat 0 82px }

it seems to work in webkit without it. But gecko needs a unit. Then it should work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜