Posted By

thesmu on 09/28/09


css am pixels units px ex

Versions (?)

CSS Units

 / Published in: CSS


  1. Length Units
  3. A length value is formed by an optional + or -, followed by a number, followed by a two-letter abbreviation that indicates the unit. There are no spaces in a length value; e.g., 1.3 em is not a valid length value, but 1.3em is valid. A length of 0 does not require the two-letter unit identifier.
  5. Both relative and absolute length units are supported in CSS1. Relative units give a length relative to another length property, and are preferred since they will better adjust to different media. The following relative units are available:
  7. em (ems, the height of the element's font)
  8. ex (x-height, the height of the letter "x")
  9. px (pixels, relative to the canvas resolution)
  10. Absolute length units are highly dependent on the output medium, and so are less useful than relative units. The following absolute units are available:
  12. in (inches; 1in=2.54cm)
  13. cm (centimeters; 1cm=10mm)
  14. mm (millimeters)
  15. pt (points; 1pt=1/72in)
  16. pc (picas; 1pc=12pt)
  17. Percentage Units
  19. A percentage value is formed by an optional + or -, followed by a number, followed by %. There are no spaces in a percentage value.
  21. Percentage values are relative to other values, as defined for each property. Most often the percentage value is relative to the element's font size.

Report this snippet  

You need to login to post a comment.