Arieh.co.il

How to recognize the structure of our document

In the previous posts I've described one of the most basic principles of HTML - It's semantic nature. In this post I would like to give an example of how I look at a document, and how to start working it out. I hope that by using this example I could show you some best practices to structure your document.

The Template

For this example I would use a free template provided by Smashing Magazine.

This is a smaller version of the template:
a small version of the bluemasters template

Before we start I want to bring your expectations down a bit - we're not going to cut this out into HTML. This will be a much shorter example, where I will outline some guidelines on how to recognize structure. Another important note is that I will not touch CSS. This is an HTML post. The basic principle which I'm trying to point out is that when marking up our document, we shouldn't bother about CSS. We should assume that when the time comes, CSS will give us all the tools we need, and thus it is not a concern.

Slicing it up

When I look at a page, I intuitively go through these steps:

  1. Identify basic sections of the page
  2. Identify main header structure.
  3. Identify all list structures on the page.

This is what I found:

But this is just the first step. Now that we've identified our basic structures, we will need to start looking for more semantic structures - such as addresses, contact information, and so on. We should also identify main repetition blocks and mark them up identically, even if they are styled differently across our site. This work could and should take quite a while. At the end, you should end up with an extended an comprehensive document, where every single piece of content is marked up appropriately - this means that you should have no single word that sits in a non-semantic element.

JavaScript Reference, JavaScript Guide, JavaScript API, JS API, JS Guide, JS Reference, Learn JS, JS Documentation