Miscellaneous Lesson #4
"Moving On Up to XHTML 1.0"
There really isn't as much difference between HTML and XHTML as you would think. XHTML can be considered HTML 5.0 yet it hasn't completely replaced HTML as of yet.
XHTML Facts - Webpage Formatting
...stands for "Extensible HyperText Markup Language"
...is meant to replace HTML
...is a stricter (and cleaner) version of HTML
...elements must be nested correctly
...elements must be closed correctly
...attributes must be closed correctly
...elements and attributes must be written in lowercase
...attributes must be quoted
...'s name attribute has been replaced by the id attribute
...elements must be enclosed within a set of html tags
Incorrect
<u><b>this is bold and underlined.</u></b>
Correct
<b><u>this is bold and underlined.</u></b>
Incorrect
<p>This is a paragraph.
<p>This is another paragraph.
Correct
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
Tags without a closing tag must still be closed correctly.
<br> ----> <br />
<img src="star.gif"> ----> <img src="star.gif" />
Incorrect
<input type="text" value="Please read this." readonly />
Correct
<input type="text" value="Please read this." readonly="readonly" />
Incorrect
This is some text.
<HR WIDTH="500" />
This is more text.
Correct
This is some text.
<hr width="500" />
This is more text.
Incorrect
<table width=100%>
Correct
<table width="100%">
Incorrect
<a name="bookmark"></a>
Correct
<a id="bookmark"></a>
Incorrect
<body><p>This is the content of my webpage.</p></body>
<html>
<head><title>This is the title of my webpage!</title></head>
</html>
Correct
<html>
<head><title>This is the title of my webpage!</title></head>
<body><p>This is the content of my webpage.</p></body>
</html>
<!DOCTYPE... the document type goes here>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta tag for character encoding goes here>
<title>...</title></head>
<body>...</body>
</html>
The document type I go into more detail here.