Posts Tagged ‘atributes’

HTML vs. XHTML

Thursday, October 4th, 2007

vs

XHTML 1.0 is a reformulation of HTML 4.0. What this really means is that learning XHTML is basically the same as learning HTML. The main difference is a few simple rules - as XHTML is more strict than standard HTML.

[1] Stricter adherence to the HTML specification
Many browsers are very lax in how they interpret HTML. This leads to incongruities in how the pages are displayed, and XHTML doesn’t allow that. The best way to correct this is to use an XHTML validator such as HTML Tidy.

[2] Write well formed documents
What this generally means is avoiding overlapping elements. The following nested code is acceptable: <p>Paragraph <em>emphasized</em></p> because the <em> tag is opened and closed within the <p> tag. However, this is not allowed: <p>Paragraph <em>emphasized</p></em> because the <em> tag overlaps the <p> tag.
(more…)