25 Pieces - Doctype and Language Declaration

Posted by weslinda on June 4, 2007 under Web Design | Read the First Comment

So this will be the first in our series on the 25 pieces that make up a solid web site. We’ll cover pieces numbers one and two in this article. They are the doctype and the language declaration.

These are two cores to a well built web site and while typically overlooked by many people. These are actually quite important pieces of information that should be included in the template for each and every web page you design.

Lets start with the Doctype declaration. To quote W3:
The document type declaration names the document type definition (DTD) in use for the document.

There are various Doctypes you can choose from. We feel the best two to work from are HTML 4.01 Strict or XHTML 1.1. Unless you truly need the XML functionality of XHTML we recommend going with HTML 4.01 Strict as an optimal base for your web site.

Here are some great resources for a more detailed look at doctype.

Declaring the language is also important so browsers and applications accessing the information can understand the language the document is in and not be forced to guess.

Language Declaration Resources:

Character Encoding Declaration:
Also important in the basic structure of your web site is a declaration of the Character set you are using for your page. The W3 tells us:
The “charset” parameter identifies a character encoding, which is a method of converting a sequence of bytes into a sequence of characters. This conversion fits naturally with the scheme of Web activity: servers send HTML documents to user agents as a stream of bytes; user agents interpret them as a sequence of characters. The conversion method can range from simple one-to-one correspondence to complex switching schemes or algorithms.

More Resources on Character Encoding:

In our next article we’ll discuss the all powerful Title Attribute of your page.

This article is a part or our series on 25 items that your web site needs to be successful.