Is it <centre> or <center>?

Viewed 118

Is the tag used for centering elements called <center> or <centre>?

I know the <centre> or <center> tag is not used anymore, but which one is the correct one?

I am confused. Visual studio code says that <center> is wrong, but only <centre> works with Microsoft Edge.

Edit: Microsoft Edge now works with <center>. It was <centre> that didn't work with Microsoft Edge

So which one is it?

1 Answers

It is <center> but this tag has been deprecated in favor of CSS property text-align

Visual studio code says that is wrong

It doesn't say is wrong, but deprecated/obsolete

Edit: Microsoft Edge now works with <center>. It was <centre> that didn't work with Microsoft edge

In HTML5 you can create custom tags (therego centre works in all modern browsers), but in older browsers you have to set them as display:block otherwise it won't work.

Best example I can remember is the reset.css from Eric Meyers

/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
  display: block;
}
Related