HTML and CSS Reference
In-Depth Information
Units
Many style attribute values use units of measurement to indicate color, length, angles,
time, and frequencies. The following table describes the measuring units used in CSS.
Units
Description
Color
Units of color
currentColor
The computed value of the color property (CSS3)
flavor
An accent color chosen by the user to customize the user interface of
the browser (CSS3)
name
A color name; all browsers recognize 16 base color names: aqua,
black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple,
red, silver, teal, white, and yellow
# rrggbb
A hexadecimal color value, where rr is the red value, gg is the green
value, and bb is the blue value
# rgb
A compressed hexadecimal value, where the r , g , and b values are
doubled so that, for example, #A2F = #AA22FF
hsl( hue , sat , light )
Color value based on hue, saturation, and lightness, where hue is the
degree measure on the color wheel ranging from 0° (red) up to 360°,
sat is the saturation range from 0% to 100%, and light is the lightness
range from 0% to 100% (CSS3)
hsla( hue , sat , light ,
alpha )
Semi-transparent color based on the HSL model with alpha represent-
ing the opacity of the color ranging from 0 (transparent) up to 1 (com-
pletely opaque) (CSS3)
rgb( red , green , blue ) The decimal color value, where red is the red value, green is the green
value, and blue is the blue value
rgb( red %, green %, blue %) The color value percentage, where red % is the percent of maximum
red, green % is the percent of maximum green, and blue % is the per-
cent of maximum blue
rgba( red , green , blue ,
alpha )
Semi-transparent color based on the RGB model with alpha repre-
senting the opacity of the color ranging from 0 (transparent) up to 1
(completely opaque) (CSS3)
Length
Units of length
auto
Keyword which allows the browser to automatically determine the
size of the length
ch
Width of the “0” glyph found in the font (CSS3)
em
A relative unit indicating the width and the height of the capital “M”
character for the browser's default font
ex
A relative unit indicating the height of the small “x” character for the
browser's default font
px
A pixel, representing the smallest unit of length on the output device
in
An inch
cm
A centimeter
mm
A millimeter
pt
A point, approximately 1/72 inch
pc
A pica, approximately 1/12 inch
%
A percent of the width or height of the parent element
xx-small
Keyword representing an extremely small font size
x-small
Keyword representing a very small font size
small
Keyword representing a small font size
 
Search WWH ::




Custom Search