zoukankan      html  css  js  c++  java
  • div 自适应高度 自动填充剩余高度

    方案1:

    Html:

    <div class="outer">
        <div class="A"> 头部DIV </div>
        <div class="B">下部DIV </div>
    </div>

    CSS:

    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:

    <div class="outer">
        <div class="A">头部DIV</div>
        <div class="B">下部DIV</div>
    </div>

    CSS:

    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/pangguoming/p/5695184.html

  • 相关阅读:
    HTML_from
    HTML_img
    python_Django默认转换器
    python_虚拟环境
    python_正则表达式
    mysql_pymysql模块
    mysql_权限管理
    mysql_子查询
    sudo权限造成的故障
    22.Linux定时任务
  • 原文地址:https://www.cnblogs.com/wangyunhui/p/10370715.html
Copyright © 2011-2022 走看看