61,115
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<style type="text/css">
html {
height: 100%;
}
body {
height: 100%;
}
* {
margin: 0;
padding: 0;
}
.box {
height: 100%;
background-color: gray;
}
.bottom {
background-color: blue;
height: 40px;
}
.main {
background-color: green;
height: calc( 100% - 40px );
}
</style>
<div class="box">
<div class="main"></div>
<div class="bottom"></div>
</div>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
html,body {
width:100%;
height:100%;
margin:0px;
padding:0px;
overflow:hidden;
}
#Main {
position:absolute;
bottom:40px;
width:100%;
height:100%;
overflow:auto;
}
#ToolBar {
position:absolute;
bottom:0px;
width:100%;
height:40px;
text-align:center;
BACKGROUND:#aaa;
overflow:hidden;
}
</style>
</head>
<body>
<div id="Main">
<p>div1</p><p>div1</p><p>div1</p><p>div1</p><p>div1</p>
<p>div1</p><p>div1</p><p>div1</p><p>div1</p><p>div1</p>
<p>div1</p><p>div1</p><p>div1</p><p>div1</p><p>div1</p>
<p>div1</p><p>div1</p><p>div1</p><p>div1</p><p>div1</p>
<p>div1</p><p>div1</p><p>div1</p><p>div1</p><p>div1</p>
<p>div1</p><p>div1</p><p>div1</p><p>div1</p><p>div1</p>
<p>div1</p><p>div1</p><p>div1</p><p>div1</p><p>div1</p>
<p>div1</p><p>div1</p><p>div1</p><p>div1</p><p>div1</p>
<p>div1</p><p>div1</p><p>div1</p><p>div1</p><p>div1</p>
<p>div1</p><p>div1</p><p>div1</p><p>div1</p><p>div1</p>
</div>
<div id="ToolBar">div2</div>
</body>
</html>
.top{
width:100%;
min-height:1000px;
float:left;
}
.bottom{
width:100%;
height:40px;
float:left;
}