PDA

View Full Version : DOCTYPE html PUBLIC ??


Stationery-Direct
24th January 2006, 19:32
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

Enigma121
24th January 2006, 20:31
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.

Tin
24th January 2006, 20:53
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

Stationery-Direct
25th January 2006, 09:38
Thanks for the information guys ;-)

Stationery-Direct
25th January 2006, 13:20
I have added the text as advised, now when I do the check I get the following:

"This page is not Valid HTML 4.01 Transitional!"

http://validator.w3.org/check?uri=http%3A%2F%2Fwww.ukaccommodationsearch.c o.uk

Any ideas?

Thanks again

Tin
25th January 2006, 13:49
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

duenna
28th January 2006, 07:27
Damon have sent you PM with instructions on how to validate your page. Should not take you long good luck!

David