Property Data Types
angle
A number immediately followed by one of the following angle unit identifiers:
deg- degrees
grad- grads
rad- radians
If the value is 0, the unit may be ommited. For example, "0deg" may be written as "0".
color
A keyword or a numerical RGB specification. Keywords are:
aqua
black
blue
fuchsia
gray
green
lime
maroon
navy
olive
orange
purple
red
silver
teal
white
yellow
This example shows different ways to specify red color.
em {color: red}em {color: rgb(255,0,0)}em {color: #f00}em {color: #ff0000}em {color: rgb(100%, 0%, 0%)}
counter
A counter is used to keep track of numbering for dynamically generated content via CSS. A counter is created using the function counter() or counters() of the content property. The counter can be incremented using the counter-increment property. The counter can be reset using the counter-reset.
This example show how to create a counter with a name "para" that will insert an uppercase roman numeral (followed by a period and a space character) before the text of a paragraph.
p:before {content: counter(para, upper-roman) ". "}p {counter-increment: para}
frequency
A positive number immediately followed by one of the following frequency unit identifiers:
Hz- Hertz
kHz- kilohertz
If the value is 0, the unit may be ommited. For example, "0Hz" may be written as "0".
identifier
A name that contains letter characters (a to z and/or A to Z), numbers (0 to 9), hyphens (-) and/or underscores (_). A name cannot start with a number or a hyphen followed by a number.
integer
An integer value. May be may be preceded by a "-" sign to indicate negative number. For example:
010-5
length
A number immediately followed by one of the following length unit identifiers:
em- The font-size of the given font.
ex- The hight of the lowercased letter "x" of the given font.
px- Pixels, relative to the viewing device.
in- Inches - 1 inch is equal to 2.54 centimeters.
cm- Centimeters.
mm- Millimeters.
pt- Points - the points used by CSS 2.1 are equal to 1/72nd of an inch.
pc- Picas - 1 pica is equal to 12 points.
Length refer to horizontal or vertical measurement.
number
A number with a decimal value. May be may be preceded by a "-" sign to indicate negative number. For example:
2.5
percentage
A number immediately followed by "%". For example:
120%
string
Text written in single or double quotes. For example:
"Hello World!"'Hello World!'"I'm here"'Jack said "Hello"'
Double quotes cannot occur inside double quotes, unless escaped as \" or \22. For example:
"Jack said \"Hello\"""Jack said \22Hello\22"
Single quotes cannot occur inside single quotes unless escaped as \' or \27. For example:
'I\'m here''I\27m here'
time
A positive number immediately followed by one of the following time unit identifier:
ms- milliseconds
s- seconds
If the value is 0, the unit may be ommited. For example, "0s" may be written as "0".
uri
A URL written as url(X) where "X" is the URL which may be enclosed in double or single quotes. For example:
url(http://xhtml.com/images/logo.gif)url('images/logo.gif')url("logo.gif")