<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>::before和::after</title>
<style>
.effect{
position: relative;
width: 50%;
height: 30%;
padding: 10%;
margin: 0 auto;
box-shadow: 0 1px 4px rgba(0,0,0,0.3),0 0 40px rgba(0,0,0,0.1) inset;
z-index: 0;
text-align: center;
}
.effect:after,.effect:before{
position: absolute;
content:"";
top:50%;
bottom: -1px;
left:30px;
right: 30px;
box-shadow: 0 0 20px rgba(0,0,0,0.8);
border-radius: 40%/20%;
z-index: -2;
}
</style>
</head>
<body>
<div>
<h1>shadow effect</h1>
::before和::after这两个主要用来给元素的前面或后面插入内容,这两个常和"content"配合使用,使用的场景最多的就是清除浮动。
</div>
</body>
</html>