HTML <center> (Center Alignment) Tag

❮ Previous Reference Next ❯

Deprecated: HTML5 Not Supported.


	<p>This is paragraph.</p>


The <center> element causes the enclosed content to be centered within the margins currently in effect.

The <center> HTML element is a block-level element that displays its block-level or inline contents centered horizontally within its containing element.

The <center> element has been deprecated in HTML 4 (and XHTML 1) in favor of the CSS text-align property, which can be applied to the <div> element or to an individual <p>.

Or centering blocks, use other CSS properties like margin-left and margin-right and set them to auto (or set margin to 0 auto).

Version: HTML 3.2, 4, 4.01

Standard Syntax


Browser Support


Use CSS for centering element, as shown in the following example:


<div style="text-align:center">
  <p>First Paragraph.</p>
  <p>Second paragraph.</p>
❮ Previous Reference Next ❯