box-shadow
属性
inset:阴影在盒子内部绘制,并在内容之上offset-xoffset-yblur-radiusspread-radiuscolor
偏移
偏移是阴影相对于本体的相对位置
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>阴影右偏移</title>
<style>
div
{
width:300px;
height:100px;
background-color:yellow;
box-shadow: 10px 0px 0px #333;
}
</style>
</head>
<body>
<div></div>
</body>
</html>模糊距离:blur-radius
blur-radius使用高斯模糊模糊阴影,阴影是元素的复制(阴影会继承元素的border-radius属性)
阴影大小:spread-radius
spread-radius默认阴影大小等于元素大小,正数阴影变大 负数阴影变小
Last updated
Was this helpful?