Textpattern: Step 2 - Structure

Establish the XHTML Page Structure for Your Content

The basic requirements for a standards-compliant XHTML document include the following:

  1. Document Type Declaration – the code that declares to the web browser what kind of document the browser is reading. For more information about the DTD, refer to Jeffrey Zeldman’s article about finding the Right Doctype.
  2. Namespace Declaration – to let the browser know how to translate text and code. To find out more about the namespace declaration, visit the New York Public Library Online Style Guide.
  3. Head – which includes meta data, the title, styles and scripts (whether linked or embedded).
  4. Body – including text headings and subheadings, navigation links, body text and footer.
  5. Close – closing tags

For an example of a basic XHTML Strict 1.0 page, take a look at the code below:

<!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" >
<head>
  <meta http-equiv="Content-Type" 
    content="text/html; charset=utf-8" />
  <meta name="author" content="Stephen Bau" />
  <meta name="keywords" content="design, graphic design, 
    Bauhouse Visual Communications, 
    Abbotsford, British Columbia, Canada" />
  <meta name="description" 
    content="Good design starts with good ideas. 
    Good ideas have the power to transform culture: 
    Imagine. Design. Build." />
  <meta name="robots" content="all" />
  <link rel="stylesheet" 
    href="http://www.bauhouse.ca/css/styles.css 
    type="text/css" media="screen" />
  <title>bauhouse</title>
</head>
<body id="design" class="practice">
  <div id="logo">
    <h1><a href="http://www.bauhouse.ca/" 
      class="noline"><span>Bauhouse</span></a></h1>
  </div><!-- End logo -->
  <div id="nav">
    <a href="/about/">about</a>
      | <a href="/ideas/">ideas</a>
      | <a href="/practice/">practice</a>
      | <a href="/connect/">connect</a>
      | <a href="/">home</a>
    </div><!-- End nav -->
<div id="pageHead"><h2>Putting ideas into practice</h2></div>
<div class="article">
<h3>It validates!</h3>
<p>I have finally entered the realm of web standards with 
  a personal website featuring valid XHTML 1.0 Strict and 
  valid CSS! Long have I desired to jump on the standards 
  bandwagon with my own site, yet have failed to find the 
  time to do so. Though I have ventured into this territory 
  for a site I designed for Pacific Coastal Airlines, 
  I had yet to accomplish such a feat with my own neglected 
  web presence.</p>
</div><!-- End article -->
<div id="footer">
<p>&copy;&nbsp;2005 Stephen Bau | 
<a href="http://www.textpattern.com/" 
title="Powered by Textpattern">Textpattern</a> | 
<a href="http://www.textdrive.com/" 
title="Hosted by TextDrive">TextDrive</a>
</p>
</div><!-- End footer -->
</body>
</html>

For more information on how best to build your sites, visit the Apple Developer Connection site to find the article about Web Page Development: Best Practices.

comments | date posted posted Friday July 8, 2005

The Builders Collective

The Builders Collective is about building community and building a repository of ideas, techniques and code for building a better world wide web.

Articles Archive > View Recent