Html – Why is the
tag deprecated in HTML

centerdeprecatedhtmltags

I am just curious as to why the <center> tag in HTML was deprecated.

The <center> was a simple way of quickly center-aligning blocks of text and images by encapsulating the container in a <center> tag, and I really cannot find any simpler way on how to do it now.

Anyone know of any simple way on how to center "stuff" (not the margin-left:auto; margin-right:auto; and width thing), something that replaces <center> ? And also, why was it deprecated?

Best Answer

The <center> element was deprecated because it defines the presentation of its contents — it does not describe its contents.

One method of centering is to set the margin-left and margin-right properties of the element to auto, and then set the parent element’s text-align property to center. This guarantees that the element will be centered in all modern browsers.