Jump to content

Someone enlighten me...


killboy

Recommended Posts

We all know XHTML will replace HTML, and most of the HTML tags are replaced using CSS.There's one thing I don't quite get: I've always used the <center></center> tags so everything inside these tags can be centered. XHTML standard says that these tags are deprecated; could anyone tell me how to replace them using CSS??And what about the 'align="center"' attribute?? How could I replace that?

Link to comment
Share on other sites

First of all, XHTML is not going to replace HTML, but in any case, the <center> tag and align attribute are deprecated in HTML 4.01. In fact, HTML 4.01 (Strict) and XHTML 1.0 Strict are exactly the same when it comes to tags and attributes, the only difference is the syntax.The <center> tag is substituted with <div style="text-align: center"></div>The align="center" attribute is substituted like this:<div style="text-align:center"><img style="margin: 0 auto;" alt="[image]"></div>Give margin: 0 auto; to the object to be centered, and give the parent element text-align: center;

Link to comment
Share on other sites

Well they also say "W3C defines XHTML as the latest version of HTML" - I think they wrote that before the HTML 5 draft came out.Really, XHTML is just HTML XML formatted. No other differences (except that you can have other XML types as islands).

Link to comment
Share on other sites

I really hope XHTML will replace HTML.Infact, there are only two things standing in the way for this to happen:1. Lack of support in IE. - Hopefully IE9 will change that.2. The W3C validator uses only DTDs. - W3C already have a schema validator, but it's not part of the markup validator (a.k.a. the HTML validator). DTDs don't allow namespaces, and can't do so. Schema can, though the official XHTML 1.0 schema isn't written to allow namespace mixing. I don't think the XHTML 1.1 one is either. Still, if namespace mixing is allowed, developepers and browser vendors alike will have one more reason to use XHTML instead of HTML. Imagine the new browser wars, this time - with prefixes in front of the proprietary tags and attributes.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...