| CSS 指令速查表 來源:小恐龍 |
|---|
文字屬性
| 屬性 | 值 | 說明 |
|---|---|---|
| font-famliy | 字型名稱 | 指定字型 |
| font-style | normal / italic / oblique | 指定字體變化 |
| font-variant | normal / small-cap | 字體大小寫 |
| font-weight | normal / bold / bolder / lighter / 100 / 200 / 300 / 400 / 500 / 600 / 700 / 800 / 900 | 字體粗細 |
| font-size | xx pt / xx% | 字體大小 |
背景和色彩
| 屬性 | 值 | 說明 |
|---|---|---|
| color | #xxxxxx / rgb(xxx , xxx , xxx) / name | 前景色彩 |
| background-color | #xxxxxx / rgb(xxx , xxx , xxx) / name | 背景色彩 |
| background-image | URL | 指定背景圖 |
| background-attachment | scroll / fixed | 背景捲軸 |
段落屬性
| 屬性 | 值 | 說明 |
|---|---|---|
| word-spacing | xx pt | 字的間距 |
| letter-spacing | xx pt | 字元間距 |
| text-decoration | none / underline / overline / line-THrough / blink | 字元修飾 |
| vertical-align | baseline / sub / super / top / text-top / middle / bottom / text-bottom | 垂直對齊 |
| text-transform | none / capitalize / uppercase / lowercase | 大小寫轉換 |
| text-align | left / right / center / justify | 水平對齊 |
| text-indent | xx pt / xx% | 文字縮排 |
| line-height | xx pt / xx% | 行高 |
圖層屬性
| 屬性 | 值 | 說明 |
|---|---|---|
| margin-top | xx pt / xx% | 上邊界寬 |
| margin-bottom | xx pt / xx% | 下邊界寬 |
| margin-left | xx pt / xx% | 左邊界寬 |
| margin-right | xx pt / xx% | 右邊界寬 |
| padding-top | xx pt / xx% | 上邊界距 |
| padding-bottom | xx pt / xx% | 下邊界距 |
| padding-left | xx pt / xx% | 左邊界距 |
| padding-right | xx pt / xx% | 右邊界距 |
| border-top-width | medium / thin / thick / xx pt | 上框線距 |
| border-bottom-width | medium / thin / thick / xx pt | 下框線距 |
| border-left-width | medium / thin / thick / xx pt | 左框線距 |
| border-right-width | medium / thin / thick / xx pt | 右框線距 |
| border-width | medium / thin / thick / xx pt | 全框線距 |
| border-color | #xxxxxx / rgb(xxx , xxx , xxx) / name | 框線色彩 |
| border-top | xx pt | 上框線寬 |
| border-bottom | xx pt | 下框線寬 |
| border-left | xx pt | 左框線寬 |
| border-right | xx pt | 右框線寬 |
| width | autoset / xx pt / xx% | 圖層寬 |
| height | autoset / xx pt / xx% | 圖層高 |
| position | absolute / relative | 相對 / 絕對位置 |
| visibility | visible / hidden | 圖層可見度 |
| z-index | 正整數 | 圖層高度順序 |
| left | xx pt / xx% | 圖層左距 |
| top | xx pt / xx% | 圖層上距 |
| 小恐龍工作坊 提供 |
|---|