#### 屬性規則
---
- 結構屬性優先級大于表現屬性;
- 盡可能的進行精確與簡寫;
- 如果值為0,則不需要有單位;
- 如果顏色含有透明度,請使用rgba命名規則;
> <span class="do">正確實踐:</span>
```css
div.example {
//結構屬性
width : 300px;
height: 150px;
//表現屬性;
display:flex;
//rgba命名
background-color: rgba(0,0,0,.5);
}
span.user-name{
//簡寫
margin: 5px 0 10px 15px;
//0不需要單位;
padding: 0;
}
```
> <span class="dont">錯誤實踐:</span>
```css
div.example {
display:flex;
width : 300px;
background-color: #000;
opactiy:.5;
height: 150px;
}
span.user-name{
margin-top: 5px;
margin-bottom:10px;
margin-left: 15px;
padding: 0px;
}
```