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;"> </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;">
</div>
</div>
<div id="footer" style="width:100%;height:30px;z-index:5;background:green;padding:0;margin:0;"> </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;
精彩评论