What's wrong with the center tag?

Yes, W3 says that it ( <center> ) is out of date ... But all browsers support it (including new releases) ...

Can anyone shed light on this, everyone says: "It's bad / frowned." but I did not see any evidence.

PLEASE READ THE QUESTION, THIS IS NOT A DUPLICATE:
I asked why it was bad / frowned, and not why it was out of date !!

Edit:
So, the only reason is that "CSS should handle this"?

+4
source share
5 answers

The problem is not that it is "bad." This is a matter of separation of concerns.

This tag is for presentation use only. It has no other semantic meaning.

Since the transition is to have the view processed by CSS, and the HTML should be used only for semantic markup, the tag is deprecated.

+11
source

The problem is not its semantic (which means that it does not describe the data, but instead what to do with it).

HTML should be semantic - its markup in the end. Does XML indicate how each of its nodes should be viewed? Also, there shouldn't be HTML, for which style sheets are needed.

About the separation of problems at the end of the day - the greater the separation, the less spaghetti soup code you create, and the greater the chance that what you write can be reused.

+1
source

It defines the presentation of its contents instead of a description. Both presentation and data must be shared.

+1
source

Like <i> or <b> , these tags did not get anything semantic. This is just a style that should be handled using CSS, not HTML.

+1
source

For a long time, the W3C has been encouraging everyone, developers and web browsers, to implement CSS to define HTML style, XHTML layouts.

This "center" element defines how certain content should be presented, while XHTML / HTML should define "document" - meaning, semantics - never "how to display content." This is the role of CSS.

This tag is supported for backward compatibility, but no one should use it in new web development, even knowing that CSS is easy, but sometimes centering some part of the layout requires advanced styling skills.

+1
source

Source: https://habr.com/ru/post/1338078/


All Articles