Main differences between xhtml and html.
In xhtml, you must only have one root element. All elements must be lowercase and closed. And, they must all be nested properly.
You used to be able to get away with things like,
<html> <head> <title>My Page</title> </head> <body> <p>This is paragraph one. <p>This is paragraph two. <img src="pic.jpg" alt="my pic"> </body> </html>
You can see that the paragraphs are not closed, including the image element.
It should look like this,
<p>This is paragraph one.</p> <p>This is paragraph two.</p> <img src="pic.jpg" alt="my pic" />
The image tag has no content -- only attributes, so it closes inside of itself.
Also, I did not declare a DOCTYPE which is required, along with a character type.
Another thing that has changed is attributes. You used to be able to get away with something like,
<select selected> <option value="val1">My Item</option> </select>
Attributes must now be attributes. The correct version would be,
<select selected="selected"> <option value="val1">My Item</option> </select>
Other examples are like, checked goes to checked="checked" and disabled goes to disabled="disabled".
[Click to add or edit comments])
Please prepend comments below including a date