zoukankan      html  css  js  c++  java
  • 1.Sticky-footer-常规布局方法

    <!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>Sticky footer布局</title>
      <style>
        * {
          margin: 0;
          padding: 0;
        }
        html,
        body {
          height: 100%;
         
        }
        body>.wrap {
          min-height: 100%;
        }
        .content {
          /* padding-bottom 等于 footer 的高度 */
          padding-bottom: 60px;
          background: #eee;
        }
        .footer {
          width: 100%;
          height: 60px;
          /* margin-top 为 footer 高度的负值 */
          margin-top: -60px;
          background: red;
        }
      </style>
    </head>
    
    <body>
      <!-- 我们所见到的大部分网站页面,都会把一个页面分为头部区块、内容区块和页脚区块,当头部区块和内容区块内容较少时,页脚能固定在屏幕的底部,而非随着文档流排布。当页面内容较多时,页脚能随着文档流自动撑开,显示在页面的最底部,这就是Sticky footer布局。 -->
      <div class="wrap">
        <div class="content">
          <h2>Sticky footer布局?</h2>
          <hr>
          <hr>
          <p>我们所见到的大部分网站页面,都会把一个页面分为头部区块、内容区块和页脚区块,当头部区块和内容区块内容较少时,页脚能固定在屏幕的底部,而非随着文档流排布。当页面内容较多时,页脚能随着文档流自动撑开,显示在页面的最底部,这就是Sticky footer布局。</p>
          <hr>
          <p>无限增加内容。。。。</p>
          
        </div>
      </div>
      <div class="footer">
        <p>这是页脚</p>
      </div>
    
    </body>
    
    </html>
  • 相关阅读:
    Django 数据库常用字段类型、选项参数、外键约束
    Django 项目基础配置
    MySQL连接列值
    SQL 限制查询结果
    python+appium+真机测试
    P3089 [USACO13NOV]POGO的牛Pogo-Cow
    P2889 [USACO07NOV]挤奶的时间Milking Time
    P2679 子串
    P3932 浮游大陆的68号岛
    P1514 引水入城
  • 原文地址:https://www.cnblogs.com/xzma/p/8522125.html
Copyright © 2011-2022 走看看