Dev Patrache

CSS 单位参考

UnitNameTypeDescriptionExample
pxPixelsabsoluteOne pixel on screen. The most basic unit.font-size: 16px;
emEmrelativeMultiple of the parent element font-size.padding: 1.5em;
remRoot EmrelativeMultiple of the root (html) element font-size.margin: 2rem;
%PercentrelativePercentage relative to the corresponding parent property.width: 50%;
vwViewport Widthviewport1% of the viewport width.width: 100vw;
vhViewport Heightviewport1% of the viewport height.height: 100vh;
vminViewport Minviewport1% of the smaller of vw and vh.font-size: 5vmin;
vmaxViewport Maxviewport1% of the larger of vw and vh.width: 50vmax;
dvhDynamic VHviewportDynamic viewport height (accounts for mobile address bar).height: 100dvh;
svhSmall VHviewportSmallest viewport height.min-height: 100svh;
lvhLarge VHviewportLargest viewport height.max-height: 100lvh;
chCharacterrelativeBased on the width of the "0" character.max-width: 60ch;
exX-HeightrelativeBased on the height of the "x" character.line-height: 2ex;
cmCentimetersabsoluteCentimeters. For print.width: 10cm;
mmMillimetersabsoluteMillimeters. For print.margin: 5mm;
inInchesabsoluteInches (1in = 96px).width: 2in;
ptPointsabsolutePoints (1pt = 1/72in).font-size: 12pt;
cqiContainer Inlinecontainer1% of the container inline size.font-size: 5cqi;
cqbContainer Blockcontainer1% of the container block size.padding: 2cqb;
19개 표시 중
最后更新:2026 · 免费在线工具

什么是 CSS 单位参考?

免费在线CSS单位参考,按类别整理px、em、rem、%、vw、vh、vmin、vmax、ch等单位的用途与用法,并说明绝对单位与相对单位的换算关系和常见取值场景。 可在编码时于一处快速查阅代码、符号、快捷键等参考信息,在浏览器中即时搜索和复制,无需注册或安装即可免费使用。 结果可一键复制,整个过程简单快捷,无需下载任何软件,在手机和电脑上都能随时流畅使用。

使用方法

  1. 1
    输入— 输入所需数据。
  2. 2
    结果— 查看处理结果。
  3. 3
    复制— 复制结果使用。

相关工具

常见问题

免费在线CSS单位参考,涵盖所有CSS长度、角度、时间单位。

不会。所有处理都在浏览器中完成。

是的,响应式设计支持移动设备。

本站使用 Cookie 以改善体验和投放广告。 了解更多