HTML or xhtml?

Newcomers to web page building are often shocked to discover that there's more than one HTML. In fact there are many.

The history of HTML is interesting - if you are a geek. You could read many books on the subject, or read Wikipedia on HTML if you only have half an hour to spare.

If you want to build web pages there are only 2 choices that matter:
There are currently 2 'standard' versions of HTML, the HyperText Markup Language.

  1. XHTML is a more recent standard and is more rigid. For example, tags must be lower case, attribute values must be in quotes. XHTML is a subset of XML, which is where these rules come from.
  2. There is a standard for HTML but it is widely ignored and most browsers try to treat invalid  HTML tolerantly. The most recent standard, 4.01, deprecates some widely used tags: you are supposed to use CSS to control appearance instead. Most web pages still use HTML, often with invalid code.


Which should you use on your web pages

If standards, XML compliance, clean separation of structure and presentation are really important to you, then use XHTML.


If ease of development and the ability to borrow components from other places is more important to you, then you can still build valid pages in HTML 4.01, supported by CSS.

I use HTML 4.01 on this site, but XHTML 1.0 on some other sites.


Whichever you use, your pages will be better behaved if you start them with a valid DOCTYPE.


Whizzywig vs xhtml

So, having decided which you want on your site, the answer seems easy for <Whizzywig:


But, it's not quite that easy, darn it.

Whizzywig uses the browser's native support for designmode. Not all browsers support designmode and Whizzywig won't work in those browsers. Ones that do are recent versions of Firefox, Mozilla, Netscape, Opera and, on Windows only, Internet Explorer.
(The most recent version of Safari has half-assed support for designmode: Whizzywig might work in some crippled fashion on Safari but I can't test it. Buy me a Mac.)

Designmode generally generates HTML, not XHTML. Commands that control font styling generate <FONT> tags: invalid in XHTML 1.0 Strict and deprecated in HTML 4.01.

Furthermore, Internet Explorer's implementation of designmode works slightly different than Mozilla's. It generates upper case tags and does not quote attributes (unless they include a space): totally invalid XHTML.

Mozilla's designmode has a nod towards XHTML by generating lower case tag names and properly quoting attributes but prefers the deprecated <b> to the more valid <strong>. I found this caused big problems if one whizzywig user edited content with Internet Explorer then another came along and updated the same content with Firefox. Or vice versa. You might get some invalid HTML.

If your use of Whizzywig is relatively simple and generates HTML that will only be edited once: for example on a message board, or e-card, or contact form; then using whizzywig.js on its own should be fine for you. Just the sort of case where you want your editor to be as light weight as possible.

If it is vital that your output is valid, even valid HTML 4.01, then you should consider using xhtml.js.

Valid XHTML is still valid HTML 4.01, but valid HTML 4.01 is not necessarily valid XHTML.

This is probably what you want if whizzywig is to be used to repeatedly edit the same content by different users with different browsers.
In a Content Management System, for example.

hide menu | Show caps
Google