<html>
<head>
<title>上下两栏布局(上部固定,下栏自适应)</title>
<meta charset="utf-8">
<style>
* {
padding: 0;
margin: 0;
}
html,body{
height: 100%;
}
</style>
</head>
<body>
<section class="layout">
<style>
.layout{
height: 100%;
}
.layout .left-content .top{
width: 100%;
height: 60px;
background-color: aqua;
}
.layout .left-content .content{
position: absolute;
top: 60px;
bottom: 0px;
width: 100%;
overflow: auto;
background-color: red;
}
</style>
<article class="left-content">
<div class="top"></div>
<div class="content">
<h1>中间自适应</h1>
</div>
</article>
</section>
</body>
</html> 上一篇:HTML中& nbsp; & ensp; & emsp;等6种空格标记
下一篇:iframe 高度100%时,超出DIV并出现垂直滚动条
讨论数量:0