How to fix: The center element is obsolete. Use CSS instead.

Most Likely Cause and Fix

Your markup makes use of a <center> element which is no longer allowed in HTML.

Use the CSS text-align property to achieve the same effect.

Use:

<div style="text-align:center">
  This text will be centered.
  <p>So will this paragraph.</p>
</div>

instead of:

<center>
  This text will be centered.
  <p>So will this paragraph.</p>
</center>

Example credit

What This Error Means

The <center> element is no longer allowed in HTML.

This error is alerting you to this fact and informing you that an equivalent end result can be achieved using CSS.

How To Fix It

Use the CSS text-align property to achieve the same effect.

Use:

<div style="text-align:center">
  This text will be centered.
  <p>So will this paragraph.</p>
</div>

instead of:

<center>
  This text will be centered.
  <p>So will this paragraph.</p>
</center>

Example credit

Discuss, Comment and Improve

Did this help you? Can this page be improved? Let us know!

comments powered by Disqus