CSS Units

Última atualização: 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 UnitsDescription
pxPixels: 1px is one device pixel (CSS reference pixel).
ptPoints: 1pt = 1/72 of an inch.
inInches: 1in = 96px = 2.54cm.
cmCentimeters.
mmMillimeters.

Relative Length

CSS UnitsDescription
emRelative to the font-size of the element.
remRelative to the font-size of the root element.
exRelative to the x-height of the element's font.
chRelative to the width of the '0' (zero) glyph.

Viewport Units

CSS UnitsDescription
vw1% of the viewport width.
vh1% of the viewport height.
vmin1% of the smaller viewport dimension.
vmax1% of the larger viewport dimension.

Percentage

CSS UnitsDescription
%Relative to another value (parent size, property context).

Angle

CSS UnitsDescription
degDegrees: a full circle is 360deg.
radRadians: a full circle is 2πrad.
turnTurns: a full circle is 1turn.

Time

CSS UnitsDescription
sSeconds.
msMilliseconds (1000ms = 1s).

Global Keywords

CSS UnitsDescription
initialSets a property to its initial (default) value.
inheritTakes the computed value from the parent.
unsetActs as inherit for inherited props, initial otherwise.
Web-Tutorial.com

Equipe Técnica Web-Tutorial

Uma plataforma de tutoriais mantida por diversos desenvolvedores. Cada tutorial é escrito e revisado por profissionais da área correspondente. Trabalhamos para manter nosso conteúdo preciso e confiável — se encontrar algum problema, avise-nos.

100%