When writing in HTML, the

tag was used to contain both block-level and inline elements on a web page. Anything contained in the
tags would be aligned with the middle of the page. The following sections contain information about this tag, including an example of it in use, and related attributes and browser compatibility.

Example of
code

Notice that this text is in the middle of the page.

Example result

Notice that this text is in the middle of the page.

The

tag is deprecated. Going forward, use the CSS “text-align” property to center elements.

  • Example of
    code.
  • Example result
  • Attributes
  • Compatibility
  • Related information

Attributes

Within an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair. While the

tag does not have any unique attributes, it utilizes all the standard attributes until it’s removed in a future version of HTML.

Compatibility

*Until it is removed in a future version of HTML

Browser, Compatibility, Container tag, Web design terms

  • How to create links to sections on the same page in HTML.
  • HTML and web design help and support.