CSS中月光的颜色代码是怎么样的呢?我们来一起学习一下吧。 body { background-color: #f3f9fc; background-image: radial-gradient(ci
CSS中月光的颜色代码是怎么样的呢?我们来一起学习一下吧。
body { background-color: #f3f9fc; background-image: radial-gradient(circle, #f3f9fc 0%, #c6e7f0 100%); } .moon { position: relative; width: 120px; height: 120px; border-radius: 50%; background-color: #fff; box-shadow: 0 0 0 10px #f3f9fc, 0 0 10px 20px #c6e7f0; } .moon::before { content: ""; position: absolute; top: 50%; left: 50%; width: 80px; height: 80px; margin: -40px 0 0 -40px; border-radius: 50%; background-color: #c6e7f0; box-shadow: inset 0 0 10px #fff; }
以上代码是一个月亮形状的div元素,它的颜色代码包括:
- 背景色:#f3f9fc
- 渐变色:radial-gradient(circle, #f3f9fc 0%, #c6e7f0 100%),这里用到了径向渐变,从#f3f9fc到#c6e7f0
- 盒子阴影:box-shadow: 0 0 0 10px #f3f9fc, 0 0 10px 20px #c6e7f0,这里的两个阴影参数分别代表外边框阴影和内边框阴影
- 前置伪元素:::before,它的颜色代码是#c6e7f0
这些颜色代码组合在一起,形成了一个类似月亮的形状,带有月光的效果。
粉丝
0
关注
0
收藏
0