<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
<style>
body{
margin:0;
}
.warper{
height:100%;
display: flex;
flex-direction:column;
align-content:stretch;
}
.header{
height:5rem;
background-color: red;
order: 0;
flex-shrink: 0;
}
.footer{
height:3rem;
background-color: blue;
order: 2;
flex-shrink: 0;
}
.container{
flex-grow:999;
order: 1;
overflow:auto;
position: relative;
}
.container .baseline{
min-height:100%;
height:100%;
overflow:auto;
}
</style>
</head>
<body>
<div class="warper">
<div class="header">header</div>
<section class="container">
<div class="baseline">
<p>container</p><p>container</p><p>container</p><p>container</p><p>container</p><p>container</p><p>container</p><p>container</p><p>container</p><p>container</p><p>container</p><p>container</p><p>container</p><p>container</p><p>container</p><p>container</p><p>container</p><p>container</p><p>container</p><p>container</p><p>container</p><p>container</p><p>container</p><p>container</p>
</div>
</section>
<div class="footer">footer</div>
</div>
</body>
</html>
html,body {
height:100%;
overflow:qhidden;
}
*{margin:0;padding:0}
li,input,button{height:35px;}
#content{
height:100%;
margin-top:100px;
margin-left:100px;
width:60%;
}
#box{
height:100%;
bottom:35px;
text-align:center;
border:1px solid red;
overflow:scroll;
}
li{
border:1px solid red;
margin-top:10px;
}
#header {
width:200px;
height:100px;
position:fixed;
top:0;
background:#FeE4B5;
}
#footer{
clear:left; /* 防止float:left对footer的影响 */
width:380px;
height:80px;
position:fixed;
bottom:0;
right:0;
background:#FFE4B5;
}
xxxxxxxxxx
function $(id) {
return document.getElementById?document.getElementById(id):document.all?d.all[id]:document.layers[id];
}
function send(){
$("box").innerHTML+="<h1>"+$("msg").value+"</h1>";
$("box").scrollTop+=1000;
}
window.onload=function(){
$("box").onscroll=function(){
console.log(this);
console.log(this.scrollTop);
}
}