CSS Size Units
In CSS we have the following units to represent sizes -
Unit | Description |
---|---|
px | Represents in pixels |
% | Relative to the parent element % |
em | Relative to the parent element font size |
rem | Relative to the font size of the borwser |
vw | Relative to viewport width % 0 being lowest 100 being highest |
vh | Relative to viewport height % 0 being lowest 100 being highest |
dvw | Accounts for sudden changes in viewport dimension but does the same thing as vw |
dvh | Accounts for sudden changes in viewport dimension but does the same thing as vh |