十六進制每兩位相同可縮寫:#000000 → #000、#336699 → #369、#f2f2f2 無法縮寫。CSS Color 4 新增 #RGBA、#RRGGBBAA 8 位寫法。
margin: 1px 2px 3px 4px; /* 上右下左 */
margin: 1px 2px; /* 上下 | 左右 */
margin: 1px 2px 3px; /* 上 | 左右 | 下 */
margin: 0; /* 四方同值,0 可省略單位 */
border: 1px solid #000; /* width style color,順序可互換但建議固定 */
border-left: 2px dashed red; /* 單邊縮寫 */
background: #f00 url(bg.gif) no-repeat fixed 0 0;
/* color | image | repeat | attachment | position-x position-y */
/* 現代擴展:size、origin、clip、gradient 皆可納入 */
background: linear-gradient(45deg, #f00, #0f0) center/cover no-repeat border-box;
font: italic small-caps bold 1em/1.4 "Lucida Grande", sans-serif;
/* style | variant | weight | size/line-height | family */
/* size 與 family 為必填,其餘可省略採預設值 */
陷阱:font: 1em "Serif" 會重置 line-height、weight、style 為預設值。
list-style: square inside url(bullet.png);
/* type | position | image */
flex: 1 1 auto; /* grow | shrink | basis */
grid: auto-flow dense / 1fr 2fr; /* template-rows / template-columns */
margin: 0 auto 水平置中需配合 width 或 max-widthbackground 縮寫會重置未聲明屬性為預設值(如 repeat: repeat)font 縮寫同理重置所有字體相關屬性