osCommerce MS2 uses HTML 4.01 Transitional. MS3 will use XHTML 1.0. The exact doctypes are actually:
For an in-depth explanation of doctypes, check this very good article from A List Apart.
We're not alone in using XHTML; I won't go through the reasons of the choice, as so much has already be written on the subject. The New York Public Library Style Guide is a simple introduction.
Rules for XHTML are slightly different:
- Tags must be closed and must not overlap (<p><b>osCommerce</p> is wrong</b>);
- Element names must be lower case (eg <INPUT type="text" onClick="check()"> must be written <input type="text" onclick="check()">);
- End tags are required (eg <p> needs a closing </p>);
- Attribute values must be quoted (<td rowspan="3">);
- Attribute-value pairs must be written in full (eg selected="selected");
- Empty elements must either have an end tag or the start tag must end with /> (eg <br />)
- Plus some other minor stuff.
As quite a lot of HTML in osCommerce is build by PHP we must go through the HTML and the PHP code both. All pages will validate.