| 屬性類別 | 縮寫語法 | 順序/關鍵點 | 預設值補充 |
|---|---|---|---|
| 顏色 | #rgb / #rrggbb | 每兩位相同可縮寫 | — |
| Margin/Padding | margin: T R B L | 順時針:上右下左;1-4 值均合法 | 0 |
| Border | border: width style color | 順序固定;style 必填 | medium / none / currentColor |
| Background | background: color image repeat attachment position | 可省略;建議寫 background-color 兜底 | transparent / none / repeat / scroll / 0% 0% |
| Font | font: style variant weight size/line-height family | **size/line-height 與 family 必填** | normal / normal / normal / 1em / normal / 瀏覽器預設字體 |
| List | list-style: type position image | 可省略 | disc / outside / none |
font: 14px "Arial"; ❌ 缺 line-height 斜線 → 解析失敗。正確:font: 14px/1.5 "Arial"; 或 font: 14px "Arial";(但 line-height 會重置為 normal)。background: url(img.png) no-repeat; 省略 color → 透明,通常無害但建議顯式寫 background-color。margin: 10px 20px 30px; → 上 10、左右 20、下 30(非上右下左)。border: none 可拆為 border-style: none 避免重置 color/width)。