zoukankan      html  css  js  c++  java
  • 管理页面布局

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>后台管理</title>
        <style>
            .pg-header{
                height: 48px;
                background-color: #2459a2;
                color: white;
            }
            .pg-content .menu{
                position: fixed;
                top: 48px;
                left: 0;
                bottom: 0;
                width: 200px;
                background-color: #dddddd;
            }
            .pg-content .content{
                position: fixed;
                top: 48px;
                right: 0;
                bottom: 0;
                left: 200px;
                background-color: purple;
                overflow: auto;
            }
            .left{
                float: left;
            }
            .right{
                float: right;
            }
        </style>
    </head>
    
    <body style="margin: 0 auto;">
        <div class="pg-header"></div>
        <div class="pg-content">
            <div class="menu left"></div>
            <div class="content left">
            </div>
        </div>
        <div class="pg-footer"></div>
    
    </body>
    </html>
    后台管理页面布局.html

    效果图:

    这种布局的好处是当content内容超出浏览器高度时,会出现滚动条的效果。

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>后台管理</title>
        <style>
            .pg-header{
                height: 48px;
                background-color: #2459a2;
                color: white;
                line-height: 48px;
            }
            .pg-header .logo{
                width: 200px;
                background-color: blueviolet;
                text-align: center;
            }
            .pg-header .user{
                height: 48px;
                margin-right: 60px;
                padding: 0 20px;
    
    
            }
            .pg-header .user .a img{
                width: 40px;
                height: 40px;
                margin-top: 4px;
                border-radius: 50%;
            }
            .pg-header .user .b{
                z-index: 20;
                position: absolute;
                top: 48px;
                right: -43px;
                background-color: #666666;
                width: 160px;
                display: block;
    
    
            }
            .pg-header .user .b a{
                color: white;
                display: block;
            }
            .pg-header .user:hover{
                background-color: #204982;
            }
            .pg-content .menu{
                position: absolute;
                top: 48px;
                left: 0;
                bottom: 0;
                width: 200px;
                background: #dddddd;
    
            }
            .pg-content .content{
                position: absolute;
                top: 48px;
                right: 0;
                bottom: 0;
                left: 200px;
                background-color: purple;
                min-width: 980px;
                z-index: 10;
                overflow: auto;
    
            }
            .left{
                float: left;
            }
            .right{
                float: right;
            }
            .pg-header .user:hover .b{
                display:block;
            }
        </style>
    </head>
    
    <body style="margin: 0 auto;">
        <div class="pg-header">
            <div class="logo left">
                后台管理
            </div>
            <div id='i1' class="user right" style="position: relative;">
                <a class='a' href="#">
                    <img class='img' src="girl.jpg"/>
                </a>
                <div class="b">
                    <a>我的资料</a>
                    <a>注销</a>
                </div>
            </div>
        </div>
    
        <div class="pg-content">
            <div class="menu left"></div>
            <div class="content left">
            </div>
        </div>
        <div class="pg-footer"></div>
    </body>
    </html>
    Demo

    图标网站:fontawesome.com

    使用教程:http://www.runoob.com/font-awesome/fontawesome-tutorial.html

  • 相关阅读:
    线段树区间异或--差分时间复杂度优化
    数独
    sql语句-根据动态参数去拼sql
    Python-读取文件的大小
    Docker-教你如何通过 Docker 快速搭建各种测试环境
    Docker-本地镜像发布到阿里云
    Docker- Mysql数据库主从同步配置方法
    mysql-如何删除主从同步
    Docker数据卷的介绍和使用
    Docker镜像-拉取并且运行
  • 原文地址:https://www.cnblogs.com/replaceroot/p/9841794.html
Copyright © 2011-2022 走看看