下表整理最常用的 CSS 屬性及其主要功能,適合經常需要自定義模板、又不想反覆翻書的人隨手查閱。
#rgb、#rrggbb、rgb(255,0,0)、rgb(100%,0%,0%)。示例 H1{color:#f00}BODY{background-color:#ff0000}url(圖片路徑)。示例 body{background-image:url(/back.jpg);}repeat-x(X 軸)、repeat-y(Y 軸)、no-repeat(不重複)scroll(滾動),fixed(固定)top/bottom/left/right/center、長度值 50px 10px 或百分比 20% 50%BODY{background:#ffcc00 url(/bg.jpg) fixed center}P{font-family:宋體,楷體,"Times New Roman";}normal、italic、oblique(斜體)normal 或 small-caps(小型大寫字母)normal、bold、lighter、bolder 或 100~900 的數值。實務中主要用 normal 與 boldxx-small~xx-large;相對關鍵字 larger、smaller;單位 pt、px、in、cm、em;或百分比font-style font-variant font-weight font-size/line-height font-family。示例 P{font:bold 12pt/14pt impact,Arial;}P{letter-spacing:5pt;}none、underline、overline、line-throughbaseline(默認)、sub、super、top、middle、bottom、text-top、text-bottomnone、capitalize(首字母大寫)、uppercase、lowercaseleft、right、center、justifydecimal、lower-roman、upper-roman、lower-alpha、upper-alpha、none;無序表符號 disc、circle、square、noneurl(圖片)outside(凸排)、inside(縮排)solid、double、groove、ridge、inset、outsetDIV{border:5pt solid #ff0000;}none(默認)、left(元素靠左,文字在右側繞排)、right(反之)none、left(左側不允許浮動元素)、right、bothinherit、visible、hidden(隱藏但保留占位)visible、hidden、scroll、auto,控制溢出內容的處理方式block、inline、inline-block、none、flex、grid 等static、relative、absolute、fixed、sticky這份清單只覆蓋入門與日常所需。CSS 屬性持續擴充(Grid、Flexbox、容器查詢、自定義屬性等),遇到具體問題時查閱最新規範永遠比背表格可靠。