css中hover上滑

<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta charset="UTF-8">
    <title>hover上滑</title>
    <style >
        .ImgBox {
            width: 130px;
            height: 130px;
            overflow: hidden;
            position: relative;
        }
        .ImgBox img{
            width:100%;
            height: 100%;
        }
        .hoverImg {
            position: absolute;
            top:130px;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.3);
        }
        .ImgBox:hover .hoverImg{
            top: 0;
            transition:all .3s ease-in-out .2s;
        }
    
    </style>
</head>
<body>
    <div class="ImgBox">
        <div class="Img">
            <img src="./images/15036308618249.jpg" alt="">
        </div>
        <div class="hoverImg"></div>
    </div>
</body>

</html>

阅读更多
个人分类: css
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭