推荐的 CSS 规范书写顺序

这里推荐先写显示属性,再写自身属性,再写文字属性;并不代表非得按这个顺序写,

但这种写法可以使css结构更清晰易读,修改起来比较方便。而且在团队项目中能更好地提高效率。

//显示属性

display<转换元素>
list-style
position<定位>
float<浮动>
clear

//自身属性
width<宽>
height<高>
margin<外边距>
padding<里边距>
border<边框>
background<背景>

//文本属性
color<颜色>
font<文字>
text-decoration
text-align<文本定位>
vertical-align
white-space
other text
content<居中>

posted @ 2011-09-22 19:15  jinrui  阅读(206)  评论(0编辑  收藏  举报