CSS Units
CSS Units measure the length, width, padding, margin, etc with the help of absolute or relative unit.An absolute unit is a fixed value such as pixel, point, inches, etc while as a relative unit such as %, em etch is relative to the parent element.
Please keep in mind that, CSS unit is applicable only for a non-zero value. Specify length with value including its unit otherwise, it would not be work. If the length value is zero(0) then, in this case, you can remove the CSS unit.
CSS Absolute Unit
The absolute length units are fixed and measured by these units such ascm, mm, in, px, pt,pc.
Unit | Description |
---|---|
cm | centimeters |
px * | pixels (1px = 1/96th of 1in) |
in | inches (1in = 96px = 2.54cm) |
mm | millimeters |
pc | picas (1pc = 12 pt) |
pt | points (1pt = 1/72 of 1in) |
In this section, all the CSS measurement unit is described. This unit is categorized into two parts namely absolute and relative units.