Answers Search Help
Boston University home page
HTML: Introduction
 
 
    Components
 
 
 
 
 
 
    Syntax
 
 
 
 
 
    Essential Tags
 
 
 
 
 
 
 
 
    HTML Headings
 
 
    Text
 
 
 
 
    Layout
 
 
 
 
 
 
 
    Links & Images
 
 
 
 
    Publishing
 
 
    Also See
 
 

Centering

Use the <center> tag for centering objects or text (such as this paragraph). The tag will center text or graphic elements on the page or within a table. Opening and closing tags are required.

<center> - opening tag
</center> - closing tag

CODE EXAMPLE:

<center>Every line<br/> in this block of text<br/> will be centered<br/> within the available text area.</center>

RESULT:

Every line
in this block of text
will be centered
within the available text area.

 

Note: The <center> tag is deprecated (no longer used) in newer dialects of HTML (HTML 4 Strict, and XTHML), since it is better served by use of a <div> tag with an align="center" attribute or a <p align="center">

WebCentral Using Publishing Learning Training Consulting WebCentral
Answers Search Help
NIS  |  OIT  |  Boston University  |   January 9, 2007