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; }

    效果:

  • 相关阅读:
    函数之形参与实参
    函数的介绍与方法
    生活如戏
    zabbix中的sql
    1
    1
    通过snmpwalk抓取设备端口的流量状况
    abc
    as
    网络质量IP获取脚本
  • 原文地址:https://www.cnblogs.com/Mickey697/p/10830510.html
Copyright © 2011-2022 走看看