Author: * Bithiah Nebet -
0 Posts
on this thread out of
48 Posts
sitewide.
Date: Nov 3, 2003 - 03:05
This tutorial focuses on some of the basic differences between HTML and XHTML. Keep in mind that XHTML is the next evolutionary step in the HTML family. The tags used to create an HTML web page are the same tags used to create an XHTML web page.
The main differences between HTML and XHTML:
The first item on an HTML page is normally the <html> tag. This is no longer the case. There are a few pieces of markup that must come at the beginning of any XHTML document. In this tutorial, we'll focus on the DOCTYPE declaration, which looks like this:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<title>Welcome to my page</title> |
<TITLE>Welcome to my page</TITLE> |
|
<p>Paragraph one</p> <p>Paragraph two</p> |
<p>Paragraph one <p>Paragraph two |
|
<p><b>This is correct</b></p> |
<p><b>This is not correct</p></b> |
|
<font face="Verdana">I love Egypt</font> |
<font face=Verdana>I love Egypt</font> |
|
*This means that the standalone attributes used in HTML (such as <td nowrap>) are no longer valid. The correct form is <td nowrap="nowrap">.
These are the main rules. There are a few other XHTML-specific rules you have to follow as you convert your pages to XHTML, but this tutorial is meant to be an overview, so we won't go into detail.
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en" lang="en">
<head>
<title>My XHTML page</title>
</head>
<body>
<p>Welcome! I'm learning XHTML.</p>
<p>XHTML was created to reduce<br />
incompatibilities between browsers.</p>
<p>Now most browsers<br />
will show my pages better.</p>
</body>
</html>
If you want to practice, see if you can break up this text into paragraphs and change the font (face and/or color) using the XHTML rules discussed here.
"By the governor's orders," said he, "conduct the prisoner to the tier beneath." "To the dungeon, then," said the corporal. "Yes; we must put the madman with the madmen." The soldiers seized Dantes, who followed passively. He descended fifteen steps, and the door of a dungeon was opened, and he was thrust in. The door closed, and Dantes advanced with outstretched hands until he touched the wall; he then sat down in the corner until his eyes became accustomed to the darkness. The jailer was right; Dantes wanted but little of being utterly mad.
|