Doctype declaration

Every html page should start with a doctype declaration. It’s what explains to the browser which version of html you’re typing in. Your page won’t validate if you don’t have this.

We’re teaching you to use xhtml transitional. This is a more flexible version of the updated html language. You can also code in strict, but, as the name implies, it’s much less forgiving. Copy and paste this into the top of your document before the html tag:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;

Dreamweaver will insert this for you when you open a new html document–just make sure that you have html transitional selected.

 

 

Doctype is only one of the elements that the validator requires you to have in an html document. It’s all already there when you create a new document in Dreamweaver. Otherwise, here’s what you’ll need:

You’ll need to add the xmlns attribute to the html tag. This is basically an absolute link that informs the browser which xml namespace is associated with your document. It’s an xhtml thing:

<html xmlns=”http://www.w3.org/1999/xhtml”&gt;

 

The meta tag isn’t required, but it helps the browser determine what kind of character encoding to use. This tag goes in the head section along with your title:

<head>
<meta http-equiv=”Content-Type” content=”text/html;charset=ISO-8859-1″ />
</head>

Advertisements

About Marguerite Halley

Marguerite has been working in digital content and design for universities and nonprofits through her entire career. As a digital content strategist at Washington University in St. Louis and a usability/content strategy consultant for nonprofits, she’s a champion for the user and an advocate for clear, engaging content on the web.

Posted on 02/07/2011, in making it work, web. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: