CSS布局--上中下布局(上下固定,中间自适应)
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
<title></title>
<style type="text/css">
* {
margin:0;
padding:0;
font-family: Calibri, Arial, Sans-Serif;
}
html,body,.box {
height:100%;
}
.box {
text-align:left;
background:#666;
display:table;
width:90%;
margin:0 auto;
position:relative;
}
.box>div {
display:table-row;
}
.header,.footer {
background:#fcc;
height:50px;
text-align: center;
line-height: 50px;;
}
.main {
background: #aec8ff;
text-align: center;
}
</style>
</head>
<body>
<div class="box">
<div class="header">
HEADER
</div>
<div class="main">
CONTENT
</div>
<div class="footer">
FOOTER
</div>
</div>
</body>
</html>