CSS Units
最終更新:2026-09-13
CSS Units
CSS units express lengths, angles, times and other quantities. They split into absolute, relative and viewport-based families.
Absolute Length
| CSS Units | Description |
px | Pixels: 1px is one device pixel (CSS reference pixel). |
pt | Points: 1pt = 1/72 of an inch. |
in | Inches: 1in = 96px = 2.54cm. |
cm | Centimeters. |
mm | Millimeters. |
Relative Length
| CSS Units | Description |
em | Relative to the font-size of the element. |
rem | Relative to the font-size of the root element. |
ex | Relative to the x-height of the element's font. |
ch | Relative to the width of the '0' (zero) glyph. |
Viewport Units
| CSS Units | Description |
vw | 1% of the viewport width. |
vh | 1% of the viewport height. |
vmin | 1% of the smaller viewport dimension. |
vmax | 1% of the larger viewport dimension. |
Percentage
| CSS Units | Description |
% | Relative to another value (parent size, property context). |
Angle
| CSS Units | Description |
deg | Degrees: a full circle is 360deg. |
rad | Radians: a full circle is 2πrad. |
turn | Turns: a full circle is 1turn. |
Time
| CSS Units | Description |
s | Seconds. |
ms | Milliseconds (1000ms = 1s). |
Global Keywords
| CSS Units | Description |
initial | Sets a property to its initial (default) value. |
inherit | Takes the computed value from the parent. |
unset | Acts as inherit for inherited props, initial otherwise. |
Web-Tutorial 技術チーム
複数の開発者によって共同維持されているプログラミングチュートリアルプラットフォーム。各チュートリアルは専門分野の開発者が執筆・レビューしています。正確で信頼性の高いコンテンツを目指しています — 問題を見つけた場合はお知らせください。
私たちについて