what are the basic differences between XHTML vs HTML...? (I was doing some research but didn't really find any answers in Wikopedia or other webpages were vague and unreliable). Why is XHTML better (or worse) and which should i be focused on for programming websites....? thanks in advance... ~T
XHTML is a reformulation of HTML but in XML format instead of SGML. Since the browser with the highest usage levels doesn't even support XHTML when served as XML (ie: a Web application, and yes, that browser is Internet Explorer), nor does it have any plans to -- and to top it off the W3C is abandoning XHTML in favor of the train wreck that is going to become HTML 5, there is really no point in using XHTML unless you serve it as HTML, in which case you might as well be using HTML 4.01 Strict anyway.
Problems serving XHTML 1.0 (full explanation) Sending XHTML as text/html Considered Harmful The perils of using XHTML properly Activating Browser Modes with Doctype - Choosing a Doctype The W3c has abandoned all development work on XHTML 2.0. In my opinion, Web pages should be produced using HTML 4.01 with a strict Doctype -- maybe migrating eventually to HTML 5 as elements/attributes become viable and stable. Again, in my opinion, XHTML 1.0 is not really bad - it is just pointless to serve it as content MIME type text/html (which is the way practically all XHTML Documents are presently being served) - it is not XHTML served this way, just HTML - refer to the first linked page above. XHTML does require good coding syntax discipline. Documents must be well-formed: all elements must have closing tags - empty elements must either have an end tag or the start tag must end with />, all elements must nest properly, lower case must be used for all HTML element and attribute names - necessary because XML syntax is case-sensitive. However, well-formed coding should be adopted as standard anyway by Web page developers for all Markup generation. James
^^ Hey Thanks Guys... I'm just beginning and was reading a little about XHTML. ...So are you saying that XHTML serves no real purpose...just Drop it and used HTML 4.01?
Pretty much. I won't hold your feet to the fire if you use XHTML though. (Then I'd have to brand myself a hypocrite.)
MSIE Browsers will not retrieve and render XHTML served as Media type application/xhtml+xml correctly. IE 6.0 release 2900 and later, IE 7.0 and IE8 will display such pages alright but will not render xml content. IE 6.0 release 2800 and earlier Browsers present a download screen -- selecting OPEN displays a plain, text only page (sans style sheet) and again will not render xml. IE7 Browsers and IE8 will skip the prolog and render HTML content in Standards mode. Microsoft's stated rationale for not recognizing XHTML Web Pages served with Media type application/xhtml+xml is set forth in the Microsoft MSIE 7.0 Blog (reiterated for MSIE 8.0). Note that Web Service Provider software often does not recognize the Media type application/xhtml+xml. In that case the Web Author wishing to serve XHTML Pages as Media type application/xhtml+xml -- maybe out of curiosity or via content negotiation (actually an exercise in futility) -- will have to contact his or her Provider to try and convince them to adopt it as the Media type to associate with specified XHTML Web Page extensions. If that doesn't work -- and it may not -- then the Web Author will be faced with the task of producing and loading up to the server a .htaccess file that provides the association. Media types can also be established via server side scripting. MIME type cannot be established via the "content-type" Meta tag -- that entry is only informational. James
Focus on XHTML it's more SEO friendly. If you need a well optimized website use XHTML, if not than use HTML 4.01 which is easy to validate to W3C standard.
XHTML is not very different from the HTML 4.01 standard. So, bringing your code up to the 4.01 standard is a good start. Our complete HTML 4.01 reference can help you with that. In addition, you should start NOW to write your HTML code in lowercase letters, and NEVER skip closing tags (like </p>).