一、Css3图片阴影效果_Css3相册阴影效果
html代码:
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Documenttitle>
<style>
body {
background-color: #fafafa;
}
.img {
width: 200px;
height: 200px;
background: white;
position: relative;
left: 100px;
top: 100px;
}
.img:hover::before,
.img:hover::after {
box-shadow: 0px 15px 10px rgba(0, 0, 0, 0.3);
}
.img::before {
content: '';
width: 50%;
height: 20px;
background: #eee;
position: absolute;
z-index: -1;
bottom: 10px;
left: 5px;
transform: skewY(-6deg);
box-shadow: 0px 15px 10px rgba(0, 0, 0, 0.1);
transition: all ease 0.8s;
}
.img::after {
content: '';
width: 50%;
height: 20px;
background: #eee;
position: absolute;
z-index: -1;
bottom: 10px;
right: 5px;
transform: skewY(6deg);
box-shadow: 0px 15px 10px rgba(0, 0, 0, 0.1);
transition: all ease 0.8s;
}
style>
head>
<body>
<div class="img">div>
body>
html>
二、效果变换过程
鼠标滑过:
更多:
Original: https://www.cnblogs.com/tianma3798/p/15704922.html
Author: 天马3798
Title: Css3图片阴影效果_Css3相册阴影效果(一)
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/553659/
转载文章受原作者版权保护。转载请注明原作者出处!