Nov

12

HTML 4.01 STRICT vs XHTML

November 12, 2007 |

Many developers who just started developing website find it’s hard to choose between HTML 4.01 STRICT and XHTML. If you know what each of them does, it’s not that hard at all to make a choice.

I prefer to use HTML 4.01 STRICT instead of the more modern XHTML.


The reasons are:

1. More browsers support HTML 4.01 STRICT, and it is as clean as XHTML when it comes to syntax. Real XHTML documents should be set as application/XML+XHTML and not as text/HTML on the server, once it’s set as application/XML+XHTML, the pages will not display in MSIE.

2. Once the most common browsers do support real XHTML, it won’t be hard to convert the documents. For now, 4.01 STRICT makes browsers display our documents as the W3C planned them to be displayed—well, most of them do.

3. You can still apply the XHTML rules in an 4.01 STRICT document, it will be rendered correctly. For example: you can write all the code tag in lowercase—as this is necessary for XHTML, but not necessary in 4.01 STRICT. (XML and XHTML are case sensitive, whereas older and lesser strict HTML versions like 4.01 STRICT aren’t.) So it will be easy to convert to XHTML once it’s supported by more browser agents.

So the conclusion is that we can always keep our document HTML 4.01 STRICT, but code it by following XHTML rules and specifications.

You can see many popular websites use HTML 4.01 STRICT, for example: Yahoo!, Google.



Similar Posts

Comments

Name (required)

Email (required)

Website

Speak your mind

1 Comment so far

  1. Aletheya on June 1, 2008 9:21 am

    While… shouldn’t we push the standard by using XHTML? I am really not an IE fan.

Sponsors




Links