Go back

CSS Size Units

In CSS we have the following units to represent sizes -

UnitDescription
pxRepresents in pixels
%Relative to the parent element %
emRelative to the parent element font size
remRelative to the font size of the borwser
vwRelative to viewport width % 0 being lowest 100 being highest
vhRelative to viewport height % 0 being lowest 100 being highest
dvwAccounts for sudden changes in viewport dimension but does the same thing as vw
dvhAccounts for sudden changes in viewport dimension but does the same thing as vh