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”>
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:
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:
<meta http-equiv=”Content-Type” content=”text/html;charset=ISO-8859-1″ />