Click to See Complete Forum and Search --> : <center> tag what replaced it in XHTML1.1


candseeme
04-16-2007, 08:10 AM
Whenever i try to validate my page as XMHTL1.1
i got the error
<center> is not a supported tag in xhtml 1.1
thanks

Mortred
04-16-2007, 08:19 AM
to center the text, it is :

align="center"

Centauri
04-16-2007, 10:27 AM
And if you want to centre an element such as a div, then it should be done using css styling margin: 0 auto; that code assigns zero top and bottom margins and auto width side margins.

Cheers
Graeme

Charles
04-16-2007, 03:21 PM
to center the text, it is :

align="center"No it's not. In XHTML 1.1, XHTML 1.0 and HTML 4.01 you need to use CSS for that, either the margin set to "auto" or the text-align set to "center".

boxxertrumps
04-17-2007, 08:42 AM
margin: 0 auto;
Sets the element centered.
text-align:center;
Sets the text inside the element to centered.

GSZX1337
04-17-2007, 10:52 PM
Can't you just use the <div> and/or <span> tags with the "align" attribute?

Jeff Mott
04-17-2007, 11:20 PM
In XHTML 1.1, no. And not in XHTML 1.0 Strict or HTML 4.01 Strict either. The align attribute was removed from these definitions.

felgall
04-18-2007, 12:12 AM
Centering is part of the appearance of the page NOT part of the content. Only the page content belongs in the (X)HTML, the appearance is defined by the stylesheet therefore you should use CSS to center things which is why those tags/attributes were removed from the (X)HTML definitions.