I mostly use the HTML <center>
tag to center most of my objects. I just wanted to confirm if the tag is still valid or not?
While I agree with the other answers, I don't agree w3schools is a good source for...well, anything really. Look to the specification itself when looking for data:
The CENTER element is exactly equivalent to specifying the DIV element with the align attribute set to "center". The CENTER element is deprecated.
Is it still valid? Nope (but it works, that's a different question), it's been deprecated since HTML4 - semantically it's just not inline with other elements.
Valid? As in "this is W3C valid markup"? Yes. (Albeit deprecated).
Should you use it? No. The <center>
tag has no semantic meaning in a web page, and is a styling element par excellence. Use proper CSS alignment and positioning to style your web pages.
For text aligning use text-align: center;
.
For element positioning use auto-width margins: margin-left: auto; margin-right: auto;
来源:https://stackoverflow.com/questions/4432410/is-the-center-tag-still-valid