欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

HTML 练习实现鼠标移到用户图像展示更多信息

程序员文章站 2022-10-05 08:47:37
``` Title Hello Python 我的信息 注销 klvchenklvchenklvchen klvchenklvc... ......
<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>title</title>
    <style>
        body{
            margin: 0;
        }

        .right{
            float: right;
        }

        .pg-header{
            height: 48px;
            line-height: 48px;
            background-color: #303a40;
            color: white;
        }

        .pg-header .logo{
            float: left;
            width: 200px;
            text-align: center;
        }

        .pg-header .user{
            padding: 0 20px;
            height: 48px;
            position: relative;
        }

        .pg-header .user:hover{
            background-color: #425a66;
        }

        .pg-header .user .a{
            height: 48px;
        }

        .pg-header .user .a img{
            width: 40px;
            height: 40px;
            margin-top: 4px;
            border-radius: 50%;
        }

        .pg-header .user .more{
            width: 200px;
            border: 1px solid darkgreen;
            position: absolute;
            top: 48px;
            right: 20px;
            background-color: #c0c0c0;
            display: none;
            z-index: 9999;
        }

        .pg-header .user:hover .more{
            display: block;
        }

        .pg-header .user .more a{
            display: block;
        }

        .pg-body .body-menu{
            position: absolute;
            top: 50px;
            bottom: 0;
            left: 0;
            width: 200px;
            border: 1px solid #336699;
        }

        .pg-body .body-content{
            position: absolute;
            top: 50px;
            bottom: 0;
            left: 210px;
            right: 0;
            border: 1px solid #336699;
            overflow: auto;
            z-index: 10;
        }

    </style>
</head>
<body>
<div class="pg-header">
    <div class="logo">hello python</div>

    <div class="user right" style="position: relative">
        <div class="a">
            <img src="1.jpg">
        </div>
        <div class="more">
            <a>我的信息</a>
            <a>注销</a>
        </div>
    </div>
</div>
<div class="pg-body">
    <div class="body-menu"></div>
    <div class="body-content">
        <p>klvchen</p><p>klvchen</p><p>klvchen</p>
        <p>klvchen</p><p>klvchen</p><p>klvchen</p>
        <p>klvchen</p><p>klvchen</p><p>klvchen</p>
        <p>klvchen</p><p>klvchen</p><p>klvchen</p>
        <p>klvchen</p><p>klvchen</p><p>klvchen</p>
        <p>klvchen</p><p>klvchen</p><p>klvchen</p>
    </div>

</div>
</body>
</html>