如何设置上面固定高度下面高度百分比自动适应浏览器的高度

来源:百度知道 编辑:UC知道 时间:2024/05/28 11:52:01
请问高手,如何设置上面div固定高度下面div高度百分比自动适应不同分辨率浏览器的高度,用div加css或js加css都可以,谢谢!!最好能给一个例子,等着急用,十分谢谢!!

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
body{height:100%;overflow:hidden;}
*{margin:0;padding:0;color:#ffffff}
html{height:100%}

.warpbox{height:100%;display:block;}
.topbox{height:100px;background:#333333;dislpay:block;width:100%}
.mainbox{background:#cccccc;dislpay:block;height:100%;width:100%}
-->
</style>
</head>

<body>
<div class="warpbox">
<div class="topbox">上面的固定高度</div>
<div class="mainbox">下面的区域