Units
em,ex,px,px,in,cm,mm,pt,pc,%,#,rgb(,,),url()
Length units (em, ex, px, px, in, cm, mm, pt, pc)
The format of a length value is an optional sign character ('+' or '-', with
'+' being the default) immediately followed by a number (with or without a decimal
point) immediately followed by a unit identifier (a two-letter abbreviation).
After a '0' number, the unit identifier is optional.
relative unitsem ems, the height of the element's font
ex x-height, ~ the height of the letter 'x'
px pixels, relative to canvas
absolute unitsin inches, 1in = 2.54cm
cm centimeters
mm millimeters
pt points, 1pt = 1/72 in
pc picas, 1pc = 12pt
Percentage units (%)
The format of a percentage value is an optional sign character ('+' or '-', with '+' being the default) immediately followed by a number (with or without a decimal point) immediately followed by '%'.
Color units (#, rgb(,,))
A color is a either a keyword or a numerical RGB specification.
#
The format of an RGB value in hexadecimal notation is a '#' immediately followed by either three or six hexadecimal characters. The three-digit RGB notation (#rgb) is converted into six-digit form (#rrggbb) by replicating digits, not by adding zeros. For example, #fb0 expands to #ffbb00. This makes sure that white (#ffffff) can be specified with the short notation (#fff) and removes any dependencies on the color depth of the display.
rgb()
The format of an RGB value in the functional notation is 'rgb(' followed by a comma-separated list of three numerical values (either three integer values in the range of 0-255, or three percentage values in the range of 0.0% to 100.0%) followed by ')'. Whitespace characters are allowed around the numerical values.
e.g. rgb(255,128,0)
URL (url())
The format of a URL value is 'url(' followed by optional white space followed by an optional single quote (') or double quote (") character followed by the URL itself followed by an optional single quote (') or double quote (") character followed by optional whitespace followed by ')'. Quote characters that are not part of the URL itself must be balanced.
e.g. url(http://localhost/index.htm)