CSS Properties Reference
Comprehensive CSS property reference — flexbox, grid, typography, animation, and more.
52 個屬性
display版面配置Defines how element is rendered in the document.
block | inline | flex | grid | inline-flex | inline-grid | none | contentsposition版面配置Specifies positioning method.
static | relative | absolute | fixed | stickytop / right / bottom / left版面配置Offset for positioned elements.
<length> | <percentage> | autofloat版面配置Moves element to left/right of container.
left | right | none | inline-start | inline-endclear版面配置Specifies what happens with the element next to a floated element.
none | left | right | both | inline-start | inline-endz-index版面配置Sets stacking order of elements.
auto | <integer>overflow版面配置Controls content that overflows element box.
visible | hidden | scroll | auto | clipwidth / height盒模型Sets element dimensions.
<length> | <percentage> | auto | min-content | max-content | fit-contentmax-width / max-height盒模型Sets maximum element dimensions.
<length> | <percentage> | none | min-content | max-contentmin-width / min-height盒模型Sets minimum element dimensions.
<length> | <percentage> | auto | min-content | max-contentmargin盒模型Space outside the element border.
<length> | <percentage> | auto (shorthand: top right bottom left)padding盒模型Space between content and border.
<length> | <percentage> (shorthand: top right bottom left)border盒模型Shorthand for border-width, border-style, border-color.
<border-width> || <border-style> || <color>border-radius盒模型Rounds corners of element border box.
<length> | <percentage> (1-4 values for corners)box-sizing盒模型How width/height is calculated.
content-box | border-boxbox-shadow盒模型Adds shadow effects around element frame.
<offset-x> <offset-y> <blur> <spread> <color> | inset | noneflex-direction彈性盒Sets main axis of flex container.
row | row-reverse | column | column-reverseflex-wrap彈性盒Whether flex items wrap onto multiple lines.
nowrap | wrap | wrap-reversejustify-content彈性盒Alignment along main axis.
flex-start | flex-end | center | space-between | space-around | space-evenlyalign-items彈性盒Default alignment along cross axis.
stretch | flex-start | flex-end | center | baselinealign-content彈性盒Multi-line flex container alignment.
flex-start | flex-end | center | space-between | space-around | stretchflex彈性盒Shorthand for flex-grow, flex-shrink, flex-basis.
none | auto | <flex-grow> <flex-shrink> <flex-basis>gap彈性盒Space between flex/grid items.
<length> | <percentage> (row-gap column-gap)grid-template-columns格線Defines columns of the grid.
none | <track-size> | repeat() | minmax() | auto-fill | auto-fitgrid-template-rows格線Defines rows of the grid.
none | <track-size> | repeat() | minmax()grid-column格線Shorthand for grid-column-start and grid-column-end.
<line> / <line> | span <number>grid-row格線Shorthand for grid-row-start and grid-row-end.
<line> / <line> | span <number>grid-area格線Named grid area or row/column shorthand.
<name> | <row-start> / <col-start> / <row-end> / <col-end>font-size排版Size of the font.
<length> | <percentage> | xx-small...xx-large | smaller | largerfont-family排版Prioritized list of font family names.
<family-name> | <generic-family> (comma-separated list)font-weight排版Weight/boldness of the font.
normal | bold | bolder | lighter | 100–900font-style排版Italic or oblique font.
normal | italic | obliqueline-height排版Height of a line box.
normal | <number> | <length> | <percentage>text-align排版Horizontal alignment of text.
left | right | center | justify | start | endtext-decoration排版Decorative lines on text.
none | underline | overline | line-through | blinktext-transform排版Capitalization of text.
none | uppercase | lowercase | capitalizeletter-spacing排版Space between characters.
normal | <length>word-spacing排版Space between words.
normal | <length>color視覺Foreground color of text and text decorations.
<color> (name, hex, rgb(), hsl(), oklch())background視覺Shorthand for all background properties.
<color> | <image> | <position> / <size> <repeat> <attachment>background-color視覺Background color of element.
<color> | transparentopacity視覺Transparency of element (0–1).
<number> (0 = transparent, 1 = opaque)visibility視覺Shows or hides element without changing layout.
visible | hidden | collapsetransition動畫Shorthand for transition properties.
<property> <duration> <easing> <delay>animation動畫Shorthand for animation properties.
<name> <duration> <easing> <delay> <iteration> <direction> <fill-mode>transform動畫Applies 2D/3D transforms.
none | translate() rotate() scale() skew() matrix()will-change動畫Hints browser about expected changes for optimization.
auto | scroll-position | contents | transform | opacitycursorUIType of mouse cursor.
auto | default | pointer | text | move | grab | not-allowed | crosshair | ...pointer-eventsUIControls when element can be target of pointer events.
auto | none | all | fill | stroke | painteduser-selectUIControls if text can be selected.
auto | none | text | all | containoutlineUIOutline drawn around element outside border.
<outline-width> || <outline-style> || <color> | noneresizeUIWhether/how user can resize element.
none | both | horizontal | vertical關於本工具
本參考涵蓋八個類別中最常用的 CSS 屬性:版面配置、盒模型、彈性盒、格線、排版、視覺、動畫和 UI 互動。
使用搜尋框按屬性名稱、說明或允許值過濾。使用類別篩選器瀏覽特定群組。
使用方法
- 在搜尋框中輸入屬性名稱或關鍵字來過濾列表。
- 從下拉選單中選擇類別,只顯示該群組。
- 每行顯示屬性名稱、類別標籤、說明和允許值。
使用情境
前端開發人員在開發過程中查找屬性名稱和有效值。學習 CSS 的學生使用參考來探索可用的屬性。
常見問題
- 是否包含所有 CSS 屬性? — 否。本參考只涵蓋最常用的屬性。
- 是否列出了帶供應商前綴的屬性? — 否。只列出不帶前綴的標準屬性。