zoukankan      html  css  js  c++  java
  • 紧贴底部的页脚

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
        <title>doc01</title>
        <style>
            * {
                padding:0;
                margin:0;
            }
            /*带有缺陷的解决方法*/
            /*body {*/
                /*90%;*/
                /*margin: 0 auto;*/
            /*}*/
            /*.wrapper {*/
                /*min-height:calc(100vh - 3em);*/
                /*background-color: antiquewhite;*/
            /*}*/
            /*更好的解决方法*/
            body {
                display: flex;
                /*flex-flow: column;*/
                min-height: 100vh;
            }
            .wrapper {
                flex: 1;
            }
    
            .footer {
                background-color: grey;
            }
        </style>
    </head>
    <body>
    <div class="wrapper">
        <header class="header">
            <h1>site name</h1>
        </header>
        <div class="main">
            <p>
                footer紧贴底部footer紧贴底部footer紧贴底部footer紧贴底部footer紧贴底部footer紧贴底部footer紧贴底部
                footer紧贴底部footer紧贴底部footer紧贴底部footer紧贴底部footer紧贴底部footer紧贴底部footer紧贴底部
                footer紧贴底部footer紧贴底部footer紧贴底部footer紧贴底部footer紧贴底部footer紧贴底部footer紧贴底部
                footer紧贴底部footer紧贴底部footer紧贴底部footer紧贴底部footer紧贴底部footer紧贴底部footer紧贴底部
            </p>
        </div>
    </div>
    <footer class="footer">
        <p>© 2015 No rights reserved.</p>
        <p>Made with ♥ by an anonymous pastafarian.</p>
    </footer>
    </body>
    </html>

    以上代码参考《css揭秘》,神奇的一本书。

  • 相关阅读:
    Zookeeper and The Infinite Zoo(CF1491D)(位运算)
    树上差分
    最近公共祖先
    极角排序
    最长路spfa
    树的基础
    树的遍历~
    最小圆覆盖板子
    动态凸包(询问点是否在凸包内部)
    凸包内最大三角形
  • 原文地址:https://www.cnblogs.com/scnuwangjie/p/5832093.html
Copyright © 2011-2022 走看看