zoukankan      html  css  js  c++  java
  • css布局-内容自适应屏幕

    css页面布局,实现内容部分自适应屏幕,当内容高度小于浏览器窗口高度时,页脚在浏览器窗口底部;当内容高度高于浏览器窗口高度时,页脚自动被撑到页面底部。

    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        html,
        body {
            width: 100%;
            height: 100%;
        }
        .main {
            overflow: hidden;
            position: relative;
            min-height: 100%;
            background: #eee;
        }
        .red {
            margin-bottom: 50px;
            height: 200px;
            background: #f00;
        }
        .footer {
            position: absolute;
            bottom: 0;
            left: 0;
            height: 50px;
            width: 100%;
            background: #0f0;
        }
    </style>
    <body>
        <div class="main">
            <div class="red"></div>       
            <div class="footer"></div>     
        </div> 
    </body>
  • 相关阅读:
    软件开发模式
    个人中心设计
    定制四则运算
    功能测试用例分析报告
    NABCD
    开发流程
    开发流程
    结对编程
    注册界面进行Toast提示
    登录注册页面修改错误
  • 原文地址:https://www.cnblogs.com/wpp281154/p/10443793.html
Copyright © 2011-2022 走看看