Where to start when creating an xHTML page
When I create a new xHTML/HTML page I like to start with a template where I can then fill in the blanks. My basic template will include the doctype for the document, the basic document tags (html, head, body, title etc), a link to my external stylesheet, and finally a ‘wrapper’ div in the body which makes things easier when specifying a width for you page or centering the layout. This is the basic framework for any xHTML document, and is the bare minimum you should start with.
The following code is my own basic xHTML template I use when creating static pages:
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
<html>
-
<head>
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
<title>Title Here</title>
-
<meta name="robots" content="index, follow" />
-
<meta name="keywords" content="" />
-
<meta name="description" content="" />
-
<link rel="stylesheet" href="css/styles.css" type="text/css" />
-
</head>
-
-
<body>
-
<div id="wrapper">
-
<h1>Title Here</h1>
-
<p>Some content here.</p>
-
</div>
-
</body>
-
</html>
If you are using Aptana Studio to write your pages, then you can find a similar template under the HTML Snippets in the IDE.

November 6th, 2008 at 10:27 pm
no xmlns=www.w3.org/1999/xhtml in your opening html tag?