CSS Units
I recently came across several CSS-Units I didn't know about. So I compiled a little list of all the currently available units.
Here a list of all size related CSS-Units for width, height, font-size, line-height etc.
Absolute units
px- Represents a pixel on the screen for devices around 96dpi or lower. For displays higher than 96dpi, onepxdoesn't actually represent a single pixel, but1 / 96of 1 inch.q-1 / 4of a millimeter.mm- One millimeter.cm- One centimeter.in- One inch (or 25.4mm).pt- One point which equals1 / 72of an inch.pc- One pica which equals 12pt </dl>
Relative units
Font-Relative
em- Oneemequals the elements font-size. If set on thefont-sizeproperty, it is calculated based on the inherited font-size.rem- Like theemunit, theremunit is relative to the font-size, but instead of using the inherited font-size, it uses the font-size of the document (i.e. the<html>font-size).ex- Oneexequals the height of the small letter x, this is also called the x-height. For most fonts, this is close to0.5em.ch- The width of the number0.
Viewport-Relative
vh-1 / 100of the height of the viewport.vw-1 / 100of the width of the viewport.vmin-1 / 100of the width or height of the viewport, whichever is smaller.vmax-1 / 100of the width or height of the viewport, whichever is bigger.