开发者

How to set a div height in this situation?

开发者 https://www.devze.com 2023-01-26 22:31 出处:网络
How to set a div#wrap height in this situation? <body style=\"height:100%;width:100%;overflow:hidden;padding:0;margin:0;\">

How to set a div#wrap height in this situation?

<body style="height:100%;width:100%;overflow:hidden;padding:0;margin:0;">
<div id="header" style="width:100%;height:50px;z-index:5;background:blue;padding:0;margin:0;">&nbsp;</div>
<div id="wrap" style="width:100%;overflow:scroll;background:red;height:100%;padding:0;margin:0;">
<div id="content" style="width:100%;height:2000px;padding:0;开发者_运维百科margin:0;">
&nbsp;
</div>
</div>
<div id="footer" style="width:100%;height:30px;z-index:5;background:green;padding:0;margin:0;">&nbsp;</div>
</body>


Is this what you are looking for?

http://jsfiddle.net/nkUwa/1/

try it in Firefox... I don't know a way to make the header and footer a fixed height, and then have the wrap and content the "remaining area" like for the frameset usage... But you can also style the header and footer as position: absolute and attached to the top and bottom of viewport, by using top: 0 and bottom: 0 respectively.


you can't actually set the height of a div height : height:100%, you might want to try min-height:400px!important; _height:400px;

0

精彩评论

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