开发者

IE7/IE8 - not displaying background image

I am designing a site that has a background image, that is simply repeated in the y axis.

#background {
  background: url("../image/bg.png") repeat-y  -43px 150开发者_运维知识库px;
}

This works fine in FireFox and Safari, but not in IE7 or IE8.

I have even added stylesheets for these 2 browsers and changed the background to a color (which worked) rather than the image.

Is there any reason why this isn't working in these 2 browsers?

Thanks


use !important in background style like this for IE7 & IE8.

#background {
  background: url("../image/bg.png") repeat-y  -43px 150px !important;
}


Does the background have any sizes? as it will need this... If it does and thats not working have you set your doctype in the page? IE Requires this...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜