XHTML Elements (tags)

Certain tags that we learned about in the basic html tutorial have been changed or deprecated in XHTML

Modified Elements

Since all elements must be closed in XHTML the HTML <br> and <hr> elements have been modified to be self closing. To do so we simply add a space after the letters followed with a slash.
<br> becomes <br /> and the <hr> becomes <hr />

Likewise with the img tag in HTML we code it;

<img border="0" alt="Colored Circle" src="images/circle.gif" width="200" height="200">

With XHTML, like the br and hr element we make this self closing.
In XHTML;

<img border="0" alt="Colored Circle" src="images/circle.gif" width="200" height="200" />

Deprecated Elements

Several elements of HTML have been deprecated with XHTML favoring the use of CSS.
The most common:

  • Font tags
  • Align tags
  • Border
  • Italic
  • Underline
  • Strike