# Units

Units are typically used to specify the height and width of an element. Not all types are supported in all browsers. The most common types are Pixel and Percentage.

Possible Unit Types Are:

  • Pixel (px): This is the most common unit type. Examples: 1px, 10px

  • Point (pt): A point represents 1/72 of an inch. Examples: 1pt, 10pt

  • Percentage (%): Percentage relative to the parent element. Examples 100%, 85%

  • Millimeters (mm): Measurement in millimeters. Examples: 10mm, 85mm

  • Inch (in): Measurement in inches. Examples: 1in, 1.5in

  • Ex (ex): Measurement relative to the height of the lowercase letter x of the parent element's font. If the parent's font size is 10 pixels and the element's size is: 2ex, then the element's size will be twice the font size of the lowercase letter "x"

  • Em (em): Measurement relative to the height of the parent element's font. If the parent element's font is 10 pixels and the element's size is 2em, the resulting size of the element will be 20 pixels (or twice the size of the parent element's font size).

  • Centimeter (cm): Measurement in centimeters. Examples: 10cm, 100cm