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 属性? — 否。本参考只涵盖最常用的属性,省略了稀少或实验性属性。
- 是否列出了带供应商前缀的属性? — 否。只列出不带前缀的标准属性。