方案 1:
Ht ML :
<div class="outer"> <div class="A"> 头部DIV </div> <div class="B">下部DIV </div> </div>
CSS:&nbs p;
html, body { h ei ght: 100%; padding: 0; m arg in: 0; } .outer { height: 100%; padding: 100px 0 0; box -s izing: border-box ; pos IT ion: relative; } .A { height: 100px; background: # BBE8 f2 ; 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; mar gin : 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自适应高度 内容请搜索以前的文章或继续浏览下面的相关文章,希望大家以后多多支持!
总结
以上是 为你收集整理的 div自适应高度自动填充剩余高度 全部内容,希望文章能够帮你解决 div自适应高度自动填充剩余高度 所遇到的问题。
如果觉得 网站内容还不错, 推荐好友。
查看更多关于div自适应高度自动填充剩余高度的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did201285