css购物车案例

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>购物车</title>
    <style>
        #shop{
            width: 100px;
            height: 40px;
            background-color: #000;
            float: right;
            border-radius: 4px;
            line-height: 40px;
            text-align: center;
            position: relative;}
        #shop a{
            font-size: 14px;
            color:#fff;
            text-decoration: none;
            }
        #shop #shop_content{
            width: 200px;
            height: 100px;
            background-color: red;
            position: absolute;
            top:40px;
            left: -100px;
            display:none;
        }
        #shop:hover #shop_content{
            display:block;
        }
    </style>
</head>
<body>
<div id="shop">
    <a href="#">购物车</a>
    <div id="shop_content"></div>
</div>
</body>
</html>

 

posted on 2019-07-03 15:15  lilyxiaoyy  阅读(1108)  评论(0编辑  收藏  举报

返回
顶部