<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<link type="text/css" rel="stylesheet" href="style.css"/>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
.wrap{
position: absolute;
width: 100%;
height: 100%;
overflow: hidden;
}
.top{
width: 100%;
height: 60px;
background: #555;
}
.middle{
width: 100%;
height: 65%;
background: #999;
margin-top: 10px;
}
.bottom{
width: 100%;
height: 20%;
background: #ccc;
margin-top: 10px;
position: absolute;
bottom: 0;
}
</style>
</head>
<body>
<div class="wrap">
<div class="top"></div>
<div class="middle"></div>
<div class="bottom"></div>
</div>
</body>
</html>
如上面所示,一共有上、中、下三块div,希望得到的结果是上中下之间的间距固定为10px,其他部分全部自适应(第一栏是固定的高度,其他两栏是百分比的高度),总高度为100%;单纯用css有办法实现吗?