CSS 样式规范
1 样式属性顺序
1、布局位置(position,top,right,z-index,display,float 等)
2、尺寸大小(width,height,padding, margin)
3、文字系列(font-size,line-height,letter-space,color, text-align
等)
4、视觉效果(background,border 等)
5、其他(animation, transition 等)
2 缩写属性和属性值
可缩写的属性中,如果属性值只有 1 个或 2 个,那应该分开写;如果大于 2
个,应该合并写在一起。这样就可以使其编译的时间最优化。例如:
没有缩写:font-family: serif;
font-size: 24px;
line-height: 1.6;
缩写后:font: 24px/1.6 serif;
可所写的属性:padding: top, right, bottom, left;