HTML:

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="style.css">
    <title>Document</title>
</head>
<body>
    <div class="imgBox">
        <img src="1.jpg" alt="">
        <img src="2.jpg" alt="">
    </div>
</body>
</html>

CSS:

body{
    margin:;
    padding:;
    display: flex;
    justify-content:center;
    align-items: center;
    min-height:100vh;
}
.imgBox{
    position: relative;
    height: 500px;
    width:500px;
    overflow: hidden;
}
.imgBox img{
    position: absolute;
    top:;
    left:;
    width:100%;
    height:100%;
    background-size: cover;
    transition: 0.5s;
}

.imgBox:hover img:nth-child(2){
    transform: translateX(-50%) scaleX(2);
    opacity:;
    filter: blur(10px);
}
.imgBox img:nth-child(1){
    transform: translateX(50%) scaleX(2);
    opacity:;
    filter: blur(10px);
}
.imgBox:hover img:nth-child(1){
    transform: translateX(0) scaleX(1);
    opacity:;
    filter: blur(0px);
}

效果图:

CSS效果:图片切换-LMLPHP

05-02 05:05