HTML and CSS Reference
The next section looks at some common properties where these values
Borders and backgrounds
Two of the most common things to style are borders and backgrounds.
Each is controlled by several different CSS properties, and each has a
shorthand notation that lets you set all the properties in a single line.
This section looks at both of them, starting with borders.
A border has a width, a type, and a color. All three can be set sepa-
rately using the properties border-width (a length), border-style (a spe-
cial property for borders), and border-color (a color, unsurprisingly):
The CSS above assumes that some elements
with appropriate classes are defined:
The shorthand notation uses the border prop-
erty. All that's required is for the same three
values to be listed with a space between:
border: 5pt dotted #333;
border: 0.25cm double #666;