Summary


HTML and XHTML are similar but differ in a couple of ways. In HTML tags don't have to be properly nested in order for the page to work. But in XHTML the tags must be nested properly in order to work. Tags in XHTML must also be lowercase and attributes must be in quoation marks. HTML does not require attributes to be put in quotations. For example in HTML a table width tag would be <table width=100%>. The correct tag for a table width in XHTML would be <table width="100%">

Common Tags That Change

HTML

XHTML

<BR> Has no ending tag
<br>...<br />
<HR> Has no ending tag
<hr>...<hr />
<table width=100%>
<table width="100%">
<img src="myimage.gif" name="my_image">
<img src="myimage.gif" id="my_image" />
<img>
<img>...<img />
<script language="Javascript">
<script type="text/javascript">
<option selected>
<option selected="selected" />
<col>
<col>...<col />
<body bgcolor=rgb>
<body bgcolor="rgb">
<frame>
<frame />

Code Snippets That Change

1. <!DOCTYPE html PUBLIC
"-W3CDTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

2.<b><i>This text is bold and italic</i></b>

3.<div lang="no" xml:lang="no">Heia Norge!</div>

4.<!DOCTYPE Doctype goes here>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Title goes here</title>
</head>
<body>
</body>
</html>

5. <blockquote>
<p>here is a long quotation here is a long quotation</p>
</blockquote>

Resources

1. http://www.web-source.net/
2. http://www.htmlcodetutorial.com/
3. http://www.htmldog.com/