颜色
三色数值最大表示白色,三色数值为 0 表示黑色
- 黑色
#ffffff
rgb(255,255,255)
- 白色
#000000
rgb(0,0,0)
rgba颜色
- Red 红色
- Green 绿色
- Blue 蓝色
- Alpha 透明度
渐变色
在 CSS 中,background-image这样的属性,可以设为渐变
CSS 中支持两种渐变,一种是线性渐变,一种是放射性渐变
线性渐变
# 这里的 direction 可以是方向,也可以是具体的角度
# to bottom
# to top
# to left
# to right
# to bottom left
# to bottom right
# to top left
# to top right
# 120deg
# 3.14rad
linear-gradient(direction, color-stop1, color-stop2, ...);
# color-stop 是一个颜色和一个区段
# rgba(255,0,0,0)
# orange
# yellow 10%
# green 20%
# lime 28px
# 产生一个金色
background: linear-gradient(45deg, gold 10%, yellow 50%, gold 90%);
放射性渐变需要一个中心点和若干个颜色
radial-gradient(shape size at position, start-color, ..., last-color);
形状
border 边框
box-shadow 阴影
border-radius 圆角