Step 1 - Templates
The first step to building a XHTML complient page is the way the template for the page is formatted. You will find that although it resembles the old fasioned HTML template, it is vastly different in the way the tags are layed out and the additional tags required to make it possible to validate it.
HTML Template
<html><head>
<title></title>
</head>
<body>
</body>
</html>
XHTML Template
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<link rel="stylesheet" type="text/css" href="main.css" />
</head>
<body>
</body>
</html>
What do the additional tags mean?
As you can see there are several differences between the XHTML and HTML basic templates. Most of the differences are there for validation purposes, however a quick explanation of the tags are below.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
This tag is used by the validator, it allows it to identify which version of WC3's standards you are using and also provides the reference link for the validator to display.
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
This tag informs the browser what kind of webpage and standards to display the page in and if its Internet Explorer what rules to break.
<link rel="stylesheet" type="text/css" href="main.css" />
This tag is the only important change for the programmer as this is how they get their decided styles onto the page, but more on that later, as first is content, then style.