100%身高(动态加载内容) [英] 100% Body Height (Content is loaded dynamically)

查看:104
本文介绍了100%身高(动态加载内容)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢在我的网站上放置一个背景。在内容静态时工作正常。
使用javascript扩展内容时,body元素不会在滚动区域上增长。
我的问题类似于这个问题: Div高度100%并扩展以适应内容注意:我已经使用了大量浮动内容,并且无法创建固定的背景div,因为我的网站无法访问。

/ p>

需要以某种方式解决这个问题。也许与JS?

  Html,Body 
{
width:100%;
身高:100%;
background-color:#ffffff;
}

正文{
display:block;
background:url('../ Images / page-bgr-top.png')center top repeat-x,
url('../ Images / page-bgr-content.png') center top repeat-y;
}


  body {overflow: auto;} 


解决方案

添加溢出:auto; 给你的身体。

  body {overflow:auto;} 

希望这有助于您。


i like to have a background all over my website. Works fine while the content static. While using javascript to extend the content, the body element don't grow over the scrolling area. My question is similar to this question: Div height 100% and expands to fit content

Note: I've used a lots of floats and can not make a fixed background div, because my website gets inaccessible.

Need to solve this somehow. Maybe with JS ?

Html, Body
{
  width: 100%;
  height: 100%;
  background-color: #ffffff;
}

Body {
  display: block;
  background: url('../Images/page-bgr-top.png') center top repeat-x,
              url('../Images/page-bgr-content.png') center top repeat-y;
}

Update: Nathan Lee answer helped me. My problem is that the scroll-bar move the background and all my all other centered content stays in position.

body {overflow:auto;}

解决方案

Add overflow:auto; to your body.

body {overflow:auto;}

Hope this helps.

这篇关于100%身高(动态加载内容)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆