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 以改善體驗和投放廣告。 瞭解更多