element almost needs no description—the clue to its purpose is right there
in its name! It centers content. This is a block-level element, so each
center element you create will produce a new block
<center>This is centered</center> <center>So is this</center> <center>And this is centered too</center>
The above markup would render as shown in Figure 1.
Note that, unlike paragraphs that are set using the
p element, margins don’t appear
above or below the three lines in this case.
This element was originally created by Netscape, but it was integrated into HTML 3.2 (the update to HTML 3, which hadn’t included this element) because it was so widely used online. It has since been deprecated in favor of using CSS for centering content.
element is typically used in a menu:
<center> <h1>Lunch Menu</h1> <p>All food cooked fresh to order.</p> <h2>Starters</h2> ⋮ </center>
Use This For …
center element could be wrapped around all the content
on a page—an approach that would affect not just the text, but the images
and tables that are on the page as well. There are not that many instances
in which this kind of effect is desirable or aesthetically pleasing, aside
from the alignment of items in a menu, as shown above. The best advice is
to not use this element, because it’s not present in the current
HTML/XHTML (Strict) standards, and thus it will cause the document in
which it’s used to be invalid. Instead, use CSS to center content: a
div element may be used as a
wrapper for the content to which the CSS
text-align:center; is applied to take care of text
Every browser listed supports this element type.