52CSS中有提到团队协作与代码规范的内容,如下:
一、显示属性
Example Source Code [www.52css.com]* display
* list-style
* position
* float
* clear
* list-style
* position
* float
* clear
二、自身属性
Example Source Code [www.52css.com]* width
* height
* margin
* padding
* border
* background
* height
* margin
* padding
* border
* background
三、文本属性
Example Source Code [www.52css.com]* color
* font
* text-decoration
* text-align
* vertical-align
* white-space
* other text
* content
* font
* text-decoration
* text-align
* vertical-align
* white-space
* other text
* content
我个人的书写习惯与之相似,略有不同的是:
1.我更倾向于在第一部分中书写与整体布局有关,与其它元素位置相关的内容 如:margin,padding;
2.整体完了再写自身,如:width,height,background;
3.最后文本:color,font,text-align...
大概格式如下:
本文介绍了一种CSS代码组织的方法,包括显示属性、自身属性及文本属性的书写习惯,并分享了作者个人的书写顺序:先整体布局相关的属性如浮动、外边距等;接着是尺寸、背景等自身属性;最后是字体颜色、对齐方式等文本属性。
188

被折叠的 条评论
为什么被折叠?



