The units in CSS may be defined as an absolute or a relative value; the list of which is written below:
UNIT | DESCRIPTION | TYPE |
---|---|---|
% | percentage | relative value; percentage of the container block |
in | inch | absolute value |
cm | centimeter | absolute value |
mm | millimeter | absolute value |
em | letter "M" (uppercase) | relative value; in web design the length of 1em is equal to the current font size; i.e., if the font being used is currently set to 12px, then 1.5em will be 1.5 * 12 = 18px size font |
ex | letter "x" (lowercase) | relative value; in web design the length of 1ex is the lowercase x-height of a current font; i.e. x-height is usually about half the font-size |
pt | point | relative value; a point of an inch. In web design that 1pt is same 1/72 of an inch |
pc | pica | relative value; in web design a 1pc is same as 12 points (12pt) |
px | pixels | relative value; one pixel (1px) is a dot on the computer screen |
Comments
No comments have been made yet.
Please login to leave a comment. Login now