In the box model,
the foreground, which is typically
text or an image, is de?¬? ned in the
XHTML markup, but a background
color or background image can only
be added with CSS.
Note that the exact widths of thin,
medium, and thick lines are not
actually de?¬? ned in the CSS speci?¬? -
cations, so these widths may vary
between browsers. The line styles,
with the exception of solid, which
is a simple unbroken line, also are
not explicitly de?¬? ned in the CSS
speci?¬? cations; a dashed line may
have different dash and space
lengths from browser to browser.
STYLIN??™ WITH CSS - CHAPTER 4 104
A common way to style a box is to make all four sides the same
color, style, and thickness. You might write something like this,
specifying each of these three properties individually:
p.warning {border-width:4px}
p.warning {border-style:solid}
p.warning {border-color:#F33;}
But when you want to style all four sides with the same width, style,
and color, as we do here, you can write a shorthand version, using
the border property like this:
p.warning {border:4px solid #F33; padding:2px}
Whichever way you choose to do it, any paragraph with the ???warning???
class would have an attention-grabbing, four-pixel-wide solid
red line around it, as shown in Figure 4.3.
The shorthand border property causes the same value be applied to
all four sides, but if you want to specify some difference between the
sides, you can do that easily.
Pages:
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146