<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>图片阴影</title>
<style>
/*-webkit-box-reflect来做倒影:
box-reflect属性值有:dirrection-方向:above向上,below向下,left向左,right向右。
offset距离:可以是数值,也可以是百分比:
mask-box-image设置倒影的遮罩图像:(1)url(2)linear-gradient线性渐变创建遮罩图像。(3)repeating-linear-gradient重复线性渐变创建遮罩图像。(4)repeating-url重复径向径向渐变创建遮罩图像。*/
.box{
width: 500px;
height: 260px;
text-align: center;
margin: 0 auto;
background: url(img/3.jpg);
-webkit-box-reflect: below 16px -webkit-linear-gradient(transparent,transparent 40%,rgba(255,255,255,0.6));
}
</style>
</head>
<body>
<div class="box"></div>
</body>
</html>
图片阴影
最新推荐文章于 2020-08-13 10:38:43 发布