1.关键字,字符串和其他文本
1.全局变量
initial ,inherit ,unset
all 接受的值就是上面这几个
all接受除了direction 和unicode-bidi之外的所有属性值
2.content 声明中需要用到的字符串,换行符是\A
3.URL
4.图像
url,images-set,gradient
5.标识符
css 生成的列表序号
counter()
2.数字和百分数
1.整数
2.百分数
3.弹性值, 后面跟fr栅格布局
3.距离
1.绝对的
2.分辨率1dppx =96dppi
3.相对长度
em 根据父元素
ex 根据字体中的小写高度
ch 根据字的进高
vm 视宽
vh 视高
vmin 高度与宽度中最小者
vmax 高度与宽度中最大者
4.计算值
clac()
5.属性值
attr(id) 常用于 content中
6.颜色
RGB,RGBA(),HSL ,HSLA(0-360,0%-100%,0%-100%,0-1)
十六进制 和坐标型
7.角度
deg 0-360
grad 0-400
rad 0-2pi
turn 0-1
8.时间和频率
s,ms
9.位置
left,center,right ,top,bottom
10.自定义值
html {
--base-color: #639;
--highlight-color: #AEA;
}
h1 {color: var(--base-color);}
h2 {color: var(--highlight-color);}
还有就是子元素会继承
html {
--gutter: 3ch;
--offset: 1;
}
ul li {margin-left: calc(var(--gutter) * var(--offset));}
ul ul li {--gutter: 6ch;;}
ul ul ul li {--offset: 3;}
接下去随便更新那个都ok
只要是爷爷生的,你爸爸打了江山var。接下去就不用再用var了,那么你就简单点就好了。苦的还是你爸爸。这么看来