HTML and CSS Reference
In-Depth Information
(see sections 4.6.2 and 4.6.3 ) to keep your centered text intact and
looking good. For example:
<center>
<nobr>
Copyright 2000 by QuatCo Enterprises.<wbr>
All rights reserved.
</nobr>
</center>
The <nobr> tags in the sample source help ensure that the text remains
on a single line, and the <wbr> tag controls where the line may be broken
if it exceeds the browser's display-window width.
Centering is useful for creating distinctive section headers, although you
may achieve the same effect with an explicit align=center attribute in
the respective heading tag. You might also center text using align=cen-
ter in conjunction with the <div> or <p> tag. In general, the <center> tag
can be replaced by an equivalent <div align=center> or similar tag, and
its use is discouraged.
Indeed, like <font> and other HTML 3.2 standard tags that have fallen
into disfavor in the wake of stylesheets, the <center> tag is deprecated
in the HTML 4 and XHTML standards, to be replaced by its CSS equi-
valent. Nonetheless, its use in HTML documents is fairly common, and
the popular browsers are sure to support it for many revisions to come.
Still, be aware of its eventual demise.
4.6.6.1. The dir and lang attributes
The dir attribute lets you advise the browser in which direction the text
within the <center> segment should be displayed, and lang lets you spe-
cify the language used within the tag. [ The dir attribute, 3.6.1.1 ] [ The
lang attribute, 3.6.1.2 ]
 
Search WWH ::




Custom Search