CSS 属性速查
CSS 常用属性速查表:布局、字体、颜色、动画等 57 个高频属性及用途。
纯浏览器本地运行,数据不上传服务器
| 属性 | 用途 |
|---|---|
color | 文字颜色 |
background-color | 背景色 |
background-image | 背景图 |
background | 背景简写 |
font-size | 字号 |
font-weight | 字重 |
font-family | 字体族 |
font-style | 斜体 |
line-height | 行高 |
text-align | 对齐 |
text-decoration | 装饰线 |
text-transform | 大小写变换 |
letter-spacing | 字间距 |
word-spacing | 词间距 |
white-space | 空白处理 |
word-break | 断词 |
overflow-wrap | 换行 |
text-overflow | 溢出省略 |
width | 宽 |
height | 高 |
min-width | 最小宽 |
max-width | 最大宽 |
margin | 外边距 |
padding | 内边距 |
border | 边框 |
border-radius | 圆角 |
box-shadow | 阴影 |
display | 显示类型 |
position | 定位 |
top/right/bottom/left | 偏移 |
z-index | 层叠 |
float | 浮动 |
clear | 清除浮动 |
overflow | 溢出 |
flex | 弹性简写 |
flex-direction | 弹性方向 |
justify-content | 主轴对齐 |
align-items | 交叉轴对齐 |
flex-wrap | 换行 |
gap | 间距 |
grid-template-columns | 网格列 |
grid-template-rows | 网格行 |
opacity | 透明度 |
visibility | 可见性 |
cursor | 光标 |
transition | 过渡 |
animation | 动画 |
transform | 变换 |
filter | 滤镜 |
clip-path | 裁剪路径 |
object-fit | 对象填充 |
list-style | 列表样式 |
outline | 轮廓 |
box-sizing | 盒模型 |
pointer-events | 指针事件 |
user-select | 选中 |
scroll-behavior | 滚动行为 |
使用说明
- 速查 CSS 高频属性:布局、字体、背景、动画。
- 搜索支持按属性名或用途过滤。
- 写样式时对照属性名与作用。
常见问题
简写属性和分写有什么区别?
如 background 是简写(一次设多个),分写(background-color 等)更精确;简写会重置未写的项。
flex 和 grid 怎么选?
一维布局(行/列)用 flex;二维布局(行列网格)用 grid;现代布局两者结合使用。