Here’s a quick check list of the important requirements of XHTML and the differences between HTML and XHTML.
Form fields need to line up. OK. Historically this was achieved using a table, and masses of markup. Although that’s still acceptable and would not fail validation, there is an easier and better way that uses less code and where using the correct tags will also cause the ‘name’ field become focused when you clicked the ‘name’ label.
Using CSS we can achieve this using less code, while providing improved usability.
The perfect place to start – a centrally aligned ‘wrapper’.
You must have the DTD (Document Type Definition) declared for this to work.
Implementing a W3C valid, cross-browser compatible CSS2 ‘Box Model’, overcoming the bugs in IE without hacking.