zoukankan      html  css  js  c++  java
  • 页面内容小于一屏时仍能头部在头部尾部在尾部

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>页面内容小于一屏时仍能头部在头部尾部在尾部</title>
        <style>
        *{
            padding:0;
            margin:0;
            text-align:center;
        }
        /*
        html, body {height: 100%;}*/
        header{
            width:100%;
            height:50px;
            background:red;
        }
        #box{
            width:100%;
            min-height:100%;
            /*height:auto;*/
            position:absolute;
        }
        .container{
            width:100%;
            min-height:100px;
            height:auto;
            
            
        }
        footer{
            width:100%;
            height:50px;
            background:blue;
            position:absolute;
            left:0;
            bottom:0;
        }
        </style>
    </head>
    <body>
            <div id="box">
            <header>
                头部
            </header>
            <div class="container">
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
                内容区<br/>
    
            </div>
            <footer>
                底部
    
            </footer>
            </div>
    </body>
    </html>

    效果图:

  • 相关阅读:
    SpringBoot 发送邮件
    @Component 爆红
    Java 调用OpenCV获取图像数据,发送Redis并从Redis获取数据显示
    xxx.bat windows Bat文件启动cmd命令运行jar包
    队列
    paramiko连接服务器
    matplotlib模块画坐标图
    获取当前时间
    jsonpath和打印模板
    提取图片中的文字
  • 原文地址:https://www.cnblogs.com/heyiming/p/6873860.html
Copyright © 2011-2022 走看看