意義
書寫規(guī)范般堆,便于查看檩帐,簡潔有序
順序
1.布局定位屬性
- display (建議放首位贸街,有關(guān)盒子模式)
- position
- float
- clear
- visibility
- overflow
2.自身屬性
- width
- height
- margin
- padding
- background
3.文本屬性
- color
- font
- text-decoration
- text-align
- vertical-align
- white-space
- break-word
4.其他屬性(CSS3)
- content
- cursor
- border-radius
- box-shadow
- text-shadow
- background:linear-gradient
案例
.simple {
/* 布局定位屬性,display建議放首位 */
display: block;
position: relative;
float: left;
/* 自身屬性 */
width: 100px
height: 100px;
margin: 0 auto;
padding: 20px 0;
/* 文本屬性 */
font-family: Arial, sans-serif;
color: #fff;
/* 其他屬性 */
bacground: rgba(0, 0, 0, .5);
border-radius: 10px;
}