zoukankan      html  css  js  c++  java
  • 页面布局之--内容区域的左右分居

    页面布局之内容区域的左右分居内容

    • overflow: auto; 控制左侧菜单是否固定
    • min- 980px; 控制当页面小于980px时出现滚动条
      页面布局overflow
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <style>
            body{
                margin: 0;
            }
            .left{
                float: left;
            }
            .right{
                float: right;
            }
            .pg-header{
                height: 48px;
                background-color: #2459a2;
                color: white;
                min- 1180px;
            }
            .pg-content .menu{
                position: absolute;
                top: 48px;
                left: 0;
                bottom: 0;
                 200px;
                background-color: #cccccc;
            }
            .pg-content .content{
                position: absolute;
                top: 48px;
                right:0;
                bottom: 0;
                left: 200px;
                background-color: #000795;
                /*min- 980px; 该项为页面缩小980px时出现滚动条,不会影响页面布局*/
                min- 980px;
    
                /*overflow: auto; 添加该项时,左侧内容框固定不动,去除后左侧会跟随滚动条上移*/
                overflow: auto;
            }
    
        </style>
    </head>
    <body>
        <div class="pg-header"></div>
        <div class="pg-content">
            <div class="menu left">
                a
            </div>
    
            <div class="content left">
                <div style="background-color: #000795">
                    <p >ss</p><p>ss</p><p>ss</p><p>ss</p><p>ss</p><p>ss</p><p>ss</p>
                    <p>ss</p><p>ss</p><p>ss</p><p>ss</p><p>ss</p><p>ss</p><p>ss</p>
                    <p>ss</p><p>ss</p><p>ss</p><p>ss</p><p>ss</p><p>ss</p><p>ss</p>
                    <p>ss</p><p>ss</p><p>ss</p><p>ss</p><p>ss</p><p>ss</p><p>ss</p>
                    <p>ss</p><p>ss</p><p>ss</p><p>ss</p><p>ss</p><p>ss</p><p>ss</p>
                </div>
            </div>
        </div>
        <div class="pg-footer"></div>
    </body>
    </html>
    
  • 相关阅读:
    Redhat7.0版本下双网卡绑定
    Zabbix3.4 Proxy搭建
    Centos7 + Mariadb主从配置
    Cacti找回管理员密码
    2017科鲁兹钥匙电池更换
    Failed to set locale, defaulting to C.UTF-8 centos8.2报错
    centos8如何重启网络服务
    gem install报错 ruby升级
    vmware fusion 11.0.0激活
    转载 centos8.1网络重启
  • 原文地址:https://www.cnblogs.com/baolin2200/p/7653458.html
Copyright © 2011-2022 走看看