HTML and CSS Reference
In-Depth Information
In a manner similar to the
font
property, the various background proper-
ties can be combined into one rule using the
background
property. he order-
ing is color, image, repeat attachment, and position. For example:
body
{ background: white url(shading.png) repeat-y static 0px 10px; }
his format is encouraged because it is more widely supported among older
browsers and is shorter to type. Any property values not speciied are given
their default values.
he important CSS properties that afect the appearance of text include
text-
align
,
text-decoration
,
text-indent
,
text-transform
,
line-height
,
letter-
spacing
,
word-spacing
,
white-space
, and
vertical-align
. Unlike the font,
background, and some other properties, there is no shorthand form to combine
the various individual properties that set the characteristics of element text.
he
text-align
property controls the horizontal alignment of content within an
element. he permissible values are
left
,
right
,
center
,
start
,
end
,
justify
,
and
inherit
. he
justify
value instructs browsers to add letter and word spacing
to the text so that each line of text—except, perhaps, the last—occupies the full
width of the element minus any padding and border. he last line of justiied
text can be controlled with the
text-align-last
property, which accepts the same
values as the
text-align
property. Authors are cautioned to use justiied text
only in the simplest cases. An element with mixed font families, sizes, and styles
may display poorly in some browsers when the text is justiied.
his property allows web authors to add certain efects to element text. he
permissible values are
underline
,
overline
,
line-through
,
blink
(which brows-
ers are not required to support), and
inherit
. Values can be combined in a
single statement. However, subsequent settings of the
text-decoration
prop-
erty will override any previous rules in efect for the same element. Proposed
CSS3 extensions for reining the line that a browser draws above, below, or
through the text include the
text-line-color
and
text-line-style
properties.
Text decoration is most commonly used to turn of the underlining of
anchor
elements where it is obvious that the content is linked, as with naviga-
tion buttons, for example:
#nav li a
{ text-decoration: none; }