html上下布局,上方高度固定,下方高度自动填满

要实现如下图所示的布局:


说明:这种页面布局十分常用,上方为固定高度,下方自动填满下方高度;下方左侧为固定宽度,下方右侧自动填满剩余宽度。

<style>
html,
body { height: 100%; padding: 0; margin: 0; }
.outer { height: 100%; position: relative; }
.A { height: 100px; background: #BBE8F2; }
.B { background: #D9C666; width: 100%; position: absolute; top: 100px ; left: 0 ; bottom: 0; }
</style>
<div class="outer">
        <div class="A"></div>
        <div class="B">
		<div class="leftp" style="width:300px;height:100%;background-color:red;float:left;">
		<div class="rightp" style="margin-left:300px;height:100%">
		</div>
   </div>


猜你喜欢

转载自blog.csdn.net/u013517229/article/details/79739680