CSS 縮寫可讓樣式更簡潔。
- 顏色:#000000 可寫成 #000。
- 邊框:border: 1px solid #000;
- margin/padding:margin: 1px 2px 3px 4px; 依序為上右下左。
- 背景:background: #f00 url(bg.gif) no-repeat fixed 0 0;
- 字體:font: italic bold 1em/1.5 "Noto Sans TC", sans-serif;
- 列表:list-style: square inside url(image.gif);
縮寫時仍需注意順序與必要值,例如 font 至少要有 font-size 與 font-family。