计划方案1:
Html:
<div class="outer">
<div class="A"> 头顶部DIV </div>
<div class="B">下边DIV </div>
</div>
CSS:
html,
body { height: 100%; padding: 0; margin: 0; }
.outer { height: 100%; padding: 100px 0 0; box-sizing: border-box ; position: relative; }
.A { height: 100px; background: #BBE8F2; position: absolute; top: 0 ; left: 0 ; width: 100%; }
.B { height: 100%; background: #D9C666; }
实际效果:
计划方案2:
HTML:
<div class="outer">
<div class="A">头顶部DIV</div>
<div class="B">下边DIV</div>
</div>
CSS:
html,
body { height: 100%; padding: 0; margin: 0; }
.outer { height: 100%; padding: 100px 0 0; box-sizing: border-box ; }
.A { height: 100px; margin: -100px 0 0; background: #BBE8F2; }
.B { height: 100%; background: #D9C666; }
实际效果:
到此这篇有关div响应式高宽比全自动添充剩下高宽比的文章内容就详细介绍到这了,大量有关div响应式高宽比 內容请检索脚本制作之家之前的文章内容或再次访问下边的有关文章内容,期待大伙儿之后多多的适用脚本制作之家!