css建议写法
1 属性顺序
定位属性 position display float left top right bottom overflow clear z-index
自身属性 width height padding border margin background
文字样式 font-family font-size font-style font-weight font-varient color
文本属性 text-align vertical-align text-wrap text-transform text-indent text-decoration letter-spacing word-spacing white-space text-overflow
CSS3 中新增属性 content box-shadow border-radius transform
2 将浏览器前缀置于前面,将标准样式属性置于最后
.box {
-webkit-transform: rotate(300deg);
-ms-transform: rotate(300deg);
transform: rotate(300deg);
}
3 优化
-
值为
0不需要单位。 -
属性值为浮动小数
0.xx,可以省略小数点之前的0。 -
不给
h1-h6元素定义过多的样式。