+ -
当前位置:首页 → 问答吧 → 怎么让网页 按比例显示大小

怎么让网页 按比例显示大小

时间:2011-07-11

来源:互联网

比如我现在有
<div id="head"></div>
<div id="content"></div>
<div id="footer"></div>

我想要固定head在最顶部, 然后footer始终在最底部, 而中间content根据不通浏览器head与footer的间隔自适应高度
不令赐教 谢谢了

作者: yyszj0911   发布时间: 2011-07-11

head,footer绝对定位,content什么都不用定义,width设为100%即可

作者: brainwkernighan   发布时间: 2011-07-11

引用 1 楼 brainwkernighan 的回复:

head,footer绝对定位,content什么都不用定义,width设为100%即可
head{position: absolute
top:0}
footer{position: absolute
bottom:0}
这样?

作者: yyszj0911   发布时间: 2011-07-11

引用 2 楼 yyszj0911 的回复:

引用 1 楼 brainwkernighan 的回复:

head,footer绝对定位,content什么都不用定义,width设为100%即可
head{position: absolute
top:0}
footer{position: absolute
bottom:0}
这样?

作者: xuexiaodong2009   发布时间: 2011-07-11

引用 3 楼 xuexiaodong2009 的回复:

引用 2 楼 yyszj0911 的回复:

引用 1 楼 brainwkernighan 的回复:

head,footer绝对定位,content什么都不用定义,width设为100%即可
head{position: absolute
top:0}
footer{position: absolute
bottom:0}
这样?

我要高度自适应阿 width 100%不是height?

作者: yyszj0911   发布时间: 2011-07-11