CSS3实现侧边栏快速定位的隐藏和消失

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_26941173/article/details/84781390

Dome

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>CSS3隐藏悬浮网站左侧标签式导航栏代码 </title>
    <style type="text/css">

        a:link,
        a:hover,
        a:visited,
        a:active {
            color: #fff;
            text-decoration: none;
        }

        body {
            height: 100%;
            width: 100%;
            margin: 0;
            padding: 0;
            background: #fff;
        }

        .card-holder {
            position: fixed;
            width: 0px;
            overflow: visible;
            right: 0px;
        }

        .card-wrapper {
            display: inline-block;
            float: right;
            clear: both;
        }

        .card {
            position: relative;
            left: 100px;
            padding: 7px 32px 7px 64px;
            margin-top: 15px;
            x-box-shadow: 0 0 8px 0px rgba(0, 0, 0, 0.5);
            box-shadow: 8px 0 8px -8px rgba(0, 0, 0, 0.5);
            background: #fff;
            transition: all 0.3s ease-in-out 0.1s;
            border-radius: 5px;
        }

        .card:hover {
            position: relative;
            left: 100%;
            margin-left: -100px;
            box-shadow: 0 -8px 8px -8px rgba(0, 0, 0, 0.5),
            0 8px 8px -8px rgba(0, 0, 0, 0.5);
            transition: all 0.3s ease-in-out;
        }

        .card-content {
            display: inline-block;
            color: #fff;
            font-family: 'Droid Sans', sans-serif;
            font-size: 16px;
            font-weight: bold;
            white-space: nowrap;
            position: relative;
            left: -15px;
        }

        .bg-01 {
            background: #977e78;
        }

    </style>
</head>

<body>

    <div class='card-holder'>
        <div class='card-wrapper'>
            <a href='#'>
                <div class='card bg-01'>
                    <span class='card-content'>更多</span>
                </div>
            </a>
        </div>
    </div>

</body>
</html>

效果:
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_26941173/article/details/84781390