Saturday, April 12, 2008

XHTML, HTML

Some basic differences required of XHTML:

1. Head and body elements are required.
2. Closing tags are always required. So an empty element is closed by adding the closing slash at the end. e.g. <br /> or <img src="myphoto.jpg" />
3. All attributes must have quotes.
4. All attributes must have values, even if they are the same as the attribute.
5. All code is in lower case. Elements, attributes, enumerated values... everything.
6. Block level elements are always displayed in a new line. e.g. <p> and <div>
7. Parents and children must be correctly nested. e.g. <p> parent and <em>child</em></p>
8. & symbol is always &amp;

No comments: