代码:
<!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>
.ball {
width: 300px;
height: 300px;
background-color: pink;
margin: 100px auto;
/* 正圆 */
border-radius: 50%;
background-image: radial-gradient(
240px at 105px 105px,
rgba(0, 0, 0, 0),
rgba(0, 0, 0, 0.85)
);
box-shadow: 10px 10px 40px rgba(0, 0, 0, 0.85);
}
.ball:nth-child(2) {
background-color: skyblue;
}
</style>
</head>
<body>
<div class="ball"></div>
<div class="ball"></div>
</body>
</html>
效果: