CSS 单位参考
| Unit | Name | Type | Description | Example |
|---|---|---|---|---|
| px | Pixels | absolute | One pixel on screen. The most basic unit. | font-size: 16px; |
| em | Em | relative | Multiple of the parent element font-size. | padding: 1.5em; |
| rem | Root Em | relative | Multiple of the root (html) element font-size. | margin: 2rem; |
| % | Percent | relative | Percentage relative to the corresponding parent property. | width: 50%; |
| vw | Viewport Width | viewport | 1% of the viewport width. | width: 100vw; |
| vh | Viewport Height | viewport | 1% of the viewport height. | height: 100vh; |
| vmin | Viewport Min | viewport | 1% of the smaller of vw and vh. | font-size: 5vmin; |
| vmax | Viewport Max | viewport | 1% of the larger of vw and vh. | width: 50vmax; |
| dvh | Dynamic VH | viewport | Dynamic viewport height (accounts for mobile address bar). | height: 100dvh; |
| svh | Small VH | viewport | Smallest viewport height. | min-height: 100svh; |
| lvh | Large VH | viewport | Largest viewport height. | max-height: 100lvh; |
| ch | Character | relative | Based on the width of the "0" character. | max-width: 60ch; |
| ex | X-Height | relative | Based on the height of the "x" character. | line-height: 2ex; |
| cm | Centimeters | absolute | Centimeters. For print. | width: 10cm; |
| mm | Millimeters | absolute | Millimeters. For print. | margin: 5mm; |
| in | Inches | absolute | Inches (1in = 96px). | width: 2in; |
| pt | Points | absolute | Points (1pt = 1/72in). | font-size: 12pt; |
| cqi | Container Inline | container | 1% of the container inline size. | font-size: 5cqi; |
| cqb | Container Block | container | 1% of the container block size. | padding: 2cqb; |
19개 표시 중
最后更新:2026 · 免费在线工具
什么是 CSS 单位参考?
免费在线CSS单位参考,按类别整理px、em、rem、%、vw、vh、vmin、vmax、ch等单位的用途与用法,并说明绝对单位与相对单位的换算关系和常见取值场景。 可在编码时于一处快速查阅代码、符号、快捷键等参考信息,在浏览器中即时搜索和复制,无需注册或安装即可免费使用。 结果可一键复制,整个过程简单快捷,无需下载任何软件,在手机和电脑上都能随时流畅使用。
使用方法
- 1输入— 输入所需数据。
- 2结果— 查看处理结果。
- 3复制— 复制结果使用。
相关工具
正则表达式速查表按元字符、量词、锚点、分组等类别整理正则表达式语法,支持搜索和一键复制模式,并兼容JavaScript正则表达式的免费正则速查表 适用于编写和测试正则表达式、SQL、代码格式化等开发工作,全部在浏览器本地处理,代码不会上传服务器,无需安装或注册即可免费使用。 结果可一键复制,整个过程简单快捷,无需下载任何软件,在手机和电脑上都能随时流畅使用。
Git 速查表免费在线Git速查表,按类别整理可搜索的常用命令,涵盖分支、合并、rebase、stash和reset,每条附带语法说明并标注危险等级,避免误删提交。 可在编码时于一处快速查阅代码、符号、快捷键等参考信息,在浏览器中即时搜索和复制,无需注册或安装即可免费使用。 结果可一键复制,整个过程简单快捷,无需下载任何软件,在手机和电脑上都能随时流畅使用。
常见问题
免费在线CSS单位参考,涵盖所有CSS长度、角度、时间单位。
不会。所有处理都在浏览器中完成。
是的,响应式设计支持移动设备。