zoukankan      html  css  js  c++  java
  • 高度自适应

    div 自适应高度 自动填充剩余高度

     

    方案1:

    Html:

    1
    2
    3
    4
    <div class="outer">
        <div class="A"> 头部DIV </div>
        <div class="B">下部DIV </div>
    </div>

    CSS:

    1
    2
    3
    4
    5
    html,
    body { height100%padding0margin0; }
    .outer { height100%padding100px 0 0; box-sizing: border-box ; positionrelative; }
    .A { height100pxbackground#BBE8F2positionabsolutetop0 left0 width100%; }
    .B { height100%background#D9C666; }

    效果:

    方案2:

    HTML:

    1
    2
    3
    4
    <div class="outer">
        <div class="A">头部DIV</div>
        <div class="B">下部DIV</div>
    </div>

    CSS:

    1
    2
    3
    4
    5
    html,
    body { height100%padding0margin0; }
    .outer { height100%padding100px 0 0; box-sizing: border-box ; }
    .A { height100pxmargin-100px 0 0background#BBE8F2; }
    .B { height100%background#D9C666; }

    效果:

  • 相关阅读:
    标准输入输出流
    打印流
    数据输入输出流
    对象操作流
    随机流
    内存输出流
    序列流
    转换流示例代码
    字符流的示例代码
    字符流
  • 原文地址:https://www.cnblogs.com/Mickey697/p/10830510.html
Copyright © 2011-2022 走看看