It can be difficult to tell the difference from HTML to XHTML at first glance. XHTML is a much more strict version of HTML. Some of the differences are small such as all the tags must be lowercase, and every tag has to be closed. There are, however, other large changes such as the fact that nothing other than layout formatting is allowed in XHTML. The advantage to using XHTML is that you know that your page will display correctly using different browsers.

Tags That Change:

1) HTML:
<br>

XHTML:
<br />

2) HTML:
<img src='whatever.jpg'>

XHTML:
<img src='whatever.jpg' alt='whatever' />


3)HTML:
<input type='text' name='whatever'>

XHTML:
<input type='text' id='whatever' />
 

4)HTML:
<meta name='keywords' content='whatever'>

XHTML:
<meta name='keywords' content='whatever' />


5)HTML:
<script language="JavaScript">

XHTML:
<script type="text/javascript">


6)HTML:
<link rel='stylesheet' type='text/css' href='whatever.css'>

XHTML:
<link rel='stylesheet' type='text/css' href='whatever.css'>


7)HTML:
<html>

XHTML:
<html xmlns="http://www.w3.org/1999/xhtml">


8)HTML:
No Doctype

XHTML:
<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 StrictEN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


9)HTML:
<table width=100>

XHTML:
<table width="100">


10)HTML:
<input checked>

XHTML:
<input check='checked'>



Examples of code snippets that change:

1)
HTML:
<p><u><strong>Whatever</u></b></p>

XHTML:
<p><u><strong>Whatever</b></strong></p>


2)HTML:
<p>Paragraph 1
<p>Paragraph 2


XHTML:
<p>Paragraph 1</p>
<p>Paragraph 2</p>


3)HTML:
<script language="JavaScript"><!--
document.write("Hello World!")
--></script>
 

XHTML:
<script type="text/javascript">
/* <![CDATA[ */
document.write("Hello World!")
/* ]]> */
</script>


4)HTML:
<strong>Whatever</strong>

XHTML:
<p><strong>Whatever</strong></p>


5) HTML:
<p align='center'>Whatever</p>

XHTML:
<style type="text/css">
/*<![CDATA[*/
p.center {text-align: center}
/*]]>*/
</style>
<p class='center'>Whatever</p>
 

Helpful Links
http://www.w3schools.com/xhtml/xhtml_intro.asp
http://www.devguru.com/technologies/xhtml/QuickRef/xhtml_coding_rules.html
http://personalweb.about.com/od/basichtml/a/409xhtml.htm