CSS3 图集效果

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            padding: 0;
            margin: 0;
            box-sizing: border-box;
            border: none;
        }
        body{
            width: 100vw;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            background: tomato;
        }
        main{
            display: flex;
            justify-content: center;
            align-items: center;
            border: none;
        }
        div{
            width: 200px;
            height: 200px;
            margin-right: 20px;
            overflow: hidden;
            border: solid 2px #00ecfd;
            transition: .5s;
        }
        div>img{
            height: 100%;
            width: 100%;
        }
        main:hover div:hover{
            transform: scale(1.6);
            filter: none;
        }
        main:hover div{
            transform: scale(.6);
            filter: blur(25px);
        }
    </style>
</head>
<body>
    <main>
    <div><img src="https://13miki.cdn.bcebos.com/af%2F712.jpg" alt=""></div>
    <div><img src="https://13miki.cdn.bcebos.com/af%2F713.jpg" alt=""></div>
    <div><img src="https://13miki.cdn.bcebos.com/af%2F714.jpg" alt=""></div>
    </main>
</body>
</html>

 

点赞

发表评论