body background bottom在firefox下的bug

body{background:url(image.jpg) 0 bottom}

 如果页面内容未超过一屏,会导致body的背景图片向内容的最低端对齐,而不是窗口

高度也只是取到了内容区的高度,但background却可以铺满整个窗口,很是怪异

原因不详

解决方案1:

将body改成html 

html{background:url(image.jpg) 0 bottom;min-height:100%}// min-height:不影响IE

解决方案2:

用js获取窗口的高度(document.documentElement.clientHeight)赋值给body的height 

posted @ 2010-07-16 16:46  web k  阅读(448)  评论(0编辑  收藏  举报