话不多说,先上代码!
根据内阴影和外阴影,最终组合成。根据阴影层级的关系。
<!DOCTYPE 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">
<title>Document</title>
<style>
*{
margin: 0px;
padding: 0px;
}
body{
background: #000;
}
div{
width: 300px;
height: 300px;
position: absolute;
left: calc(50% - 150px);
top: calc(50% - 150px);
border-radius: 50%;
box-shadow: inset 0px 0px 50px #fff,
inset 10px 0px 80px #f0f,
inset -10px 0px 80px #0ff,
inset 0px 0px 150px #f0f,
inset -10px 0px 150px #0ff,
0px 0px 50px #fff,
-10px 0px 50px #f0f,
10px 0px 50px #0ff;
}
</style>
</head>
<body>
<div></div>
</body>
</html>