DOCTYPE html PUBLIC ??

Stationery-Direct

Free Member
Jul 12, 2005
1,304
123
Ive just checked on http://validator.w3.org/ and I am missing DOCTYPE html PUBLIC from all my pages for some reason.

I use Dreamweaver and would have thought that it would have put this in for me.

Is it important?

What exactly should I put and should I put it on every page (about 2,000 at last count). My website is just basic HTML with a bit of java, nothing fancy if that helps.

Thanks for your help

Damon
 
The normal doctype used these days is...

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

This is for "standard" HTML. There are other types which support for example XHTML. It will depend on the type of document that you have created and the tag conventions it uses.

Try the line above and see how you get on.
 
Upvote 0

Tin

Business Member
Nov 14, 2005
2,931
1,427
Herefordshire
www.tinsoldierdesign.co.uk
Hi Damon

Dreamweaver does not auto add a doc type into the page unless you've got Dreamweaver MX version 6 onwards. Earlier versions needed you to add it manually.
Technically, the doctype tells the browser how to display the page, if you don't have a doctype the browser will revert to 'quirks mode' in order to display your website. Quirks mode can be looked at as a basic rendition of your page so that your visitors can actually see something in their browser towards what you expected them to see as opposed to a more strict way of working.
For the most part non doctype sites work fine (but can be browser dependent)and display fine but as other folk will mention, it's a good idea to design sites that conform to well established guidelines as laid down by w3.org from the outset.
As far as harming any search engine rankings, having no doctype won't impact on them as current engine robots do not require doctypes in place in order to determine where your site belongs in the ranking criteria, they look at other criteria instead. If ever they do require doctypes as part of a sites coding you'll see an instant reduction of around 50% of sites indexed :)

If you are unsure which doctype to use I'd suggest a 4.01 transitional one as suggested by Enigma may well suit your needs as you mention your site is simple html coding but it would be sensible to go to w3.org and read a little about it anyway.

Hope that helps a bit

Ray
 
Upvote 0

Tin

Business Member
Nov 14, 2005
2,931
1,427
Herefordshire
www.tinsoldierdesign.co.uk
Hi

As you've now got a doctype in the page the w3 validator can at least check the code, previously you had no doctype so the validator would have been unable to identify the page (makes sense when you think about it) :)
Now being able to check your code because the doctype is in place it has thrown you 21 errors that you need to fix before the page will be valid code in accordance with the doctype you used.

Only had a quick glance at your errors but they're all simple to fix and mostly just mistakes that can easily slip in unnoticed until you try to validate a page.

Just a case of you working through them one by one.

Ray
 
Upvote 0

Latest Articles