您的位置:首页 > Web前端 > CSS

CSS布局--上中下布局(上下固定,中间自适应)

2015-07-23 13:43 726 查看
<!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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: