zoukankan      html  css  js  c++  java
  • 2.Sticky-footer-flexbox布局方法

    <!DOCTYPE html>
    <html lang="en">
    
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <meta http-equiv="X-UA-Compatible" content="ie=edge">
      <title>2.Sticky-footer-flexbox布局方法</title>
      <style>
        html,
        body {
          display: flex;
          height: 100%;
          flex-direction: column;
        }
        body .content {
          flex: 1;
          background: #eee;
        }
        .footer {
          background: red;
        }
      </style>
    </head>
    
    <body>
      <!-- 内容区域 -->
      <div class="content">
        <h2>Sticky-footer-flexbox布局方法</h2>
        <hr>
        <hr>
        <p>经典套路相比,首先是 HTML 部分,内容区域 content 不再需要 wrap 容器然后 CSS 部分减肥成功,仅仅使用四行代码,就解决了曾经困扰了一代人的难题而且使用 Flexbox,就不需要限定 footer 的高度,让页面布局更加灵活当然缺点也是显而易见的,只有 IE10 及以上的浏览器才支持 flex 布局</p>
        <hr />
      </div>
      <!-- 底部 -->
      <div class="footer">
        <p>这是页脚</p>
      </div>
    </body>
    
    </html>
  • 相关阅读:
    Eclipse中配置约束
    c++ 虚函数
    cocos3 menu
    cocos3 封装一个ball
    cocos3 内存管理机制
    cocos3 多文件拆分cocos
    cocos3 labelttf
    cocos3 messagebox
    cocos3 log
    cocos3 director sprite scene之间的关系
  • 原文地址:https://www.cnblogs.com/xzma/p/8522131.html
Copyright © 2011-2022 走看看