XHTML Starters

Like I mentioned in my HTML 4.01 Starters Snippets Post I like to keep a bank of starter files in a portable library that is managed using a program called Snippets. Ever since I started using Snippets I have seriously cut development time in half.

The following group of snippets contains snippets specifically for XHTML documents. If you are not familiar with the differences in the XHTML DOCTYPES you can jump over to my earlier post on XHTML DOCTYPES & Rules post to learn all about them. Knowing the requirements of each flavor as well as XHTML as a whole is very important.

XHTML 1.0 Transitional

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="Page Description" />
<meta name="keywords" content="Keywords" />
<meta name="Author" content="Chad M. Ostroff, chad.ostroff@mac.com" />
<title>Page Title</title>
</head>

<body>
<p>Page Content Goes Here</p>
</body>
</html>

XHTML 1.0 Strict

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="Page Description" />
<meta name="keywords" content="Keywords" />
<meta name="Author" content="Chad M. Ostroff, chad.ostroff@mac.com" />
<title>Page Title</title>
</head>

<body>
<p>Page Content Goes Here</p>
</body>
</html>

XHTML 1.1

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="Page Description" />
<meta name="keywords" content="Keywords" />
<meta name="Author" content="Chad M. Ostroff, chad.ostroff@mac.com" />
<title>Page Title</title>
</head>

<body>
<p>Page Content Goes Here</p>
</body>
</html>

XHTML Mobile 1.0

<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="Page Description" />
<meta name="keywords" content="Keywords" />
<meta name="Author" content="Chad M. Ostroff, chad.ostroff@mac.com" />
<title>Page Title</title>
</head>

<body>
<p>Page Content Goes Here</p>
</body>
</html>

Join The Conversation

All comments are moderated.

* Denotes required field.

*