Menu
Hi, I’ve been coding my page using XHTML Strict DTD, but I’ve read that if you don’t have to use XHTML, you shouldn’t. And I’m pretty sure now that I don’t need it.
My site uses CSS, Javascript, and Spry (which I believe is just the usage of CSS and Javascript together), and that’s about it.
When would you need to use XHTML?
And is it recommended to switch to HTML if XHTML is not needed? Is it worth the extra work?
Thanks for any help.
........
[b]HTML Advantages[/b]
-Slightly easier to write
-Very lenient on coding errors (HTML parser will correctly close unclosed tags, etc).[/quote]
-Compatible with all browsers.[/quote]More specifically it's compatible with IE, which still has the lion's share of users, whether we like it or not.
[b]XHTML Advantages[/b]
-Significantly more strict on coding errors (This is an advantage for some people like me, makes fixing problems much easier if code is valid).[/quote]
-Faster parse time (if served as XML to supporting browsers).
-It's XML. It means you can define custom tags, much more document control, etc. (again, only if served as XML to supporting browsers).
[/quote]
-Future safe.[/quote]
I still only serve it (XHTML) as text/html to all browsers.[/QUOTE]
You think HTML isn't as 'future safe'?[url=http://www.w3.org/html/wg/html5/]HTML5[/url] is on the horizon.
Frustrating though it is, without IE support, xhtml potential will not be realised on the web. As I read it, IE8 will probably not support xhtml. Maybe IE9 will. In the meantime,[url=http://hixie.ch/advocacy/xhtml]this advice[/url] remains sound, I think.[/QUOTE]
I did note that even though page validates HTML STRICT with TIDY, with the XHTML !doctype, it cites about two dozen 'warnings' missed otherwise. -I find this quite valuable.[/QUOTE]
And maybe IE12 will support HTML5. I can't really see any of the browsers rushing to support it as it is not being developed by the W3C to which all of the browser companies belong.[/QUOTE]
The good news is that the W3C has picked up the call, and the WhatWG and W3C working drafts of HTML 5 are now advancing in tandem.[/quote]
XHTML documents must have one root element[/QUOTE]
I would rather go for XHTML for my website, coz it is an advanced HTML version[/QUOTE]Huh? it offers no additional advances as yet
and supports XML syntax[/QUOTE]XML is not a markup language.
XHTML elements must be properly nested[/QUOTE]So should html elements
XHTML elements must always be closed[/QUOTE]Non-content-holding html elements are implicitly closed by default - what's the advantage?
XHTML elements must be in lowercase[/QUOTE]Html code can be written lowercase as well - and looks more readable in my opinion.
XHTML documents must have one root element[/QUOTE]???
XHTML documents must have one root element[/quote]
???[/QUOTE]
Quote: XHTML documents must have one root elementThe root element in HTML and XHTML documents is the HTML element (marked by the <html> tag). Of course XHTML and HTML both have only one root element, so there's certainly no advantage.
???[/quote]
0.1.9 — BETA 6.16