Приглашаем посетить
Религия (religion.niv.ru)

Appendix: Value Types

Table of Contents
Previous Next

Appendix: Value Types

The following table shows the value types, available values, samples, and some general comments regarding the use of property values within CSS.

Note 

 Not all value types are represented here, only the ones used in this book. There are additional types available for aural style sheets and counters. You can find information on these value types at www.w3.org/TR/REC-CSS2/syndata.html#values.

Value Types

Value Type

Available Values

Example(s)

Notes

Integers and Real Numbers

0-9

line-height: 1.3;

Line-height is the only property that accepts a real number; z-index is the only property to accept integers.

Lengths:
Relative Units

Height of M (em)
Height of X (ex)
Pixels (px)

0.95em
1.0ex
14px

Relative unit lengths are scaled according to the size of the parent element.

Lengths:
Absolute Units

Inches (in)
Centimeters (cm)
Millimeters (mm)
Points (pt)
Picas (pc)

1in
2cm
2mm
12pt
12pc

Absolute length units do not scale.

Lengths:
Keywords

xx-small, x-small, small, smaller, medium, large, larger, x-large, xx-large

font-size: large

Keyword measurements do not necessarily scale. These keywords apply only to font-size.

Percentages

%

width: 100%

 

URL + URN =

URI url()

url(/images/012/logo.gif)

Single or double quotes maybe used inside the parentheses. You must escape commas, parentheses, whitespace characters, and single and double quotes which appear in a URI with a backslash.

Colors:
Keywords

aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, orange, purple, red, silver, teal, white, yellow

color: orange;

Most named colors are not part of the web-safe palette.

Colors:
Hexadecimal

#hexvalue

color: #FFFFFF

 

Colors:
Hexadecimal Shorthand

#hexvalue

color: #FFF

Only available for paired values. All web-safe colors can be written in shorthand.

Colors:
RGB

#hexvalue

color: (255, 255, 255)

 

Colors:
RGB

%

color: (80%, 30%, 20%)

 
Table of Contents
Previous Next