What Are The Differences Between HTML And XHTML
HTML is probably the most successful document markup language in the world, but when XML was introduced a new way of presenting this was needed and XHTML was created.
If your document is just pure XHTML 1.0 you will not notice much difference between this and HTML. However, if you plan on using more XML tools as they become available, such as XSLT for tranforming documents, you will start noticing the advantages of using XHTML.
XForms for instance will allow you to edit XHTML documents (or any other sort of XML document) in simple controllable ways. Semantic Web applications will be able to take advantage of XHTML documents. You can't do that sort of thing with HTML.
HTML is not in XML format, therefore you cannot use XML applications in an HTML format. If you plan on using any form of XML in the near future, it is advisable to start with or convert old HTML in an XHTML format. HTML Tidy gives you the option to transform any HTML document into an XHTML one. Coffee Cup HTML Editor also offers an easy conversion method.
However, if you feel more comfortable with the older standards or are just starting off and don't want to even consider the changes involved in learning how to use XML, then stick with HTML. It will limit you, but it can be read by almost every browser out there if you use the codes correctly.
HTML browsers accept any input, correct or incorrect, and try to make something sensible of it. This error-correction makes browsers very hard to write, especially if all browsers are expected to do the same thing.
It has also meant that huge numbers of HTML documents are incorrect, because since they display OK in the browser, the author isn't aware of the errors. This makes it incredibly difficult to write new web user agents since documents claiming to be HTML are often so poor.
All browsers know how to deal with correct HTML. However, if it is incorrect, the browser has to repair the document, and since not all browsers repair documents in the same way, this introduces differences, so that your document may look and work differently on different browsers.
Since there are hundreds of different browsers, and more coming all the time like on PDAs, mobile phones, televisions, printers, and even refrigerators, coming up with a standard language to be used on every browser became necessary.
It is impossible to test your document on every browser. If you use incorrect HTML and your document doesn't work on a particular browser, it is your fault; if you use correct HTML and it doesn't work, it is a bug in the browser.
XHTML has become the standard as it forces the web designer to strive for correct design that all browsers can access. This common language makes the message you are trying to convey come across correct to everyone in the way you intended.
To keep up with the changes, I highly recommend convert to or start off using XHTML instead of HTML.
![]() |
JCE Enterprises Related Sites |
