Screen Printing

TUTORIALS » HTML / JavaScript » HTML essentials (guided tutorials)


Page 6 of 6

Common XHTML errors

Some of the most common errors in the usage of XHTML are:

Not closing empty elements

<br />

Not closing non-empty elements
<p>Hello World<p>How are you?

<p>Hello World</p> <p>How are you?</p>

Improperly nesting elements (in the wrong order)
<i><b>Hello World</i></b>

<i><b>Hello World</b></i>

Not putting quotation marks around attribute values
  Incorrect: <img src=myimage.jpg width=200 height=300 />
<img src="myimage.jpg" width="200" height="300" />

Using the ampersand character outside of entities
<p>Cars & Trucks</p>

<p>Cars &amp; Trucks</p>

Failing to recognize that XHTML elements and attributes are case sensitive
<B>Hello World</B>

<b>Hello World</b>

More pages of this tutorial → XHTML vs HTML  <123456

Comments & Questions