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

  • 相关阅读:
    vue.js报错:Module build failed: Error: No parser and no file path given, couldn't infer a parser.
    安装node
    java四大特性理解(封装继承多态抽象)
    在成功道路上,你要百败百战
    职场观察:高薪需要什么?
    jBPM4工作流应用开发指南
    WebService技术简介
    如何获得Android设备名称(ADB命令详细介绍)
    how-to-fix-fs-re-evaluating-native-module-sources-is-not-supported-graceful
    QQ文件没有读取权限,60017导致QQ无法登陆的终极解决办法
  • 原文地址:https://www.cnblogs.com/replaceroot/p/9841794.html
Copyright © 2011-2022 走看看