What’s the difference between XHTML and HTML
I’ve heard it said that xhtml is better than html. OK….what’s the difference though.
I first read the article “XHTML Explained” on JavaScriptKit.com which was written and contributed by Dev Articles
This article assumes that you are familiar with html (o.k. there), and that you know what XML and DTDs are (well…not entirely) It explains that XHTML is html “reformulated” to combine the best of both HTML and XML. This newer standard has more rules and guidelines than that of html. You must close all tags and nest tags properly. Now, I usually develop my pages html strict, so I do nest tags properly, but with XHTML you have to be careful to close them properly, other wise the result will be that they are indeed not nested properly. Also, you must put attribute values in quotes. And you’ll need to link to external style sheets and javascript docs, rather that having inline styles.
Fairly, simple if you already write strict html. But why bother making the switch. Well the article goes on to say that because of the strict guidelines of xhtml, it is backwards compatible, meaning it will show better in an older browser, that is not xhtml compliant than that of an html document that might have sloppy code. Also, that it is a standard of the World Wide Web Consortium and is the future of webpage design.
~ by kerricummins on January 26, 2008.
Posted in Uncategorized
Tags: attributes quoted, close tags, combine html and xml, devarticles.com, html, javascriptkit.com, xhtml

Leave a Reply