Forum Moderators: open

Message Too Old, No Replies

Whats doctype all about....?

what does it do & how does it work...?

         

cyberjunky

1:15 am on Aug 12, 2004 (gmt 0)

10+ Year Member



hi, whats doctype all about and how would i use it, i got a snippit and just wondering specifiacally and non-specifically it does....?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">

thnx inadvance, Cyberjunky

tbeach

1:38 am on Aug 12, 2004 (gmt 0)

10+ Year Member



All pages should have a doctype. Among other things it tells what 'language' you are using html, xhtml, etc.,
and whether you have tagged the page following strict, transitional, or frame guidelines.

The first step in tagging a good page and in my opinion the first step in Search Engine Optimization is to validate the page. [validator.w3.org...]

Without the doctype it will not validate.

I have heard that eventually pages without doctypes will not render. If that's true, I expect it's a ways away.

I tag in xhtml and validate strict. That may come back to bite me but I'm prepared to lower the standards to transitional if need be.

Here's the first 2 lines of all my pages:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Sorry I don't have the other options in front of me but you can find them at w3schools.com.

My advice is to just accept that you need to have a doctype and get into the habit of using it.
Then validate the page. It's a great habit to get into as it will show you the errors and you can correct them before you post it.

AND The search engines will love you.
Tom

tedster

2:08 am on Aug 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here's the W3C information:

List of Valid Doctypes [w3.org]

cyberjunky

2:21 am on Aug 12, 2004 (gmt 0)

10+ Year Member



thnx a bunch, i will start to use them from now on if they will increase chances of getting into a search engine.

kaled

8:47 am on Aug 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I doubt search engines care very much about doctype. Provided they can distinuguish text from markup and identify emphasis tags such as bold, italic, H1, etc. then I would expect them to be happy.

Users care about content not doctypes, therefore search engines should too.

Kaled.

ronin

11:44 am on Aug 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Users care about content not doctypes

Well, true, but not all users searching Google are using IE 5.5 / IE 6.0 on a desktop PC. It's not much good if the top results in Google won't render properly on a mac or a PDA - that will just make Google look bad.

A correct doctype at the start of a page and valid markup is not a guarantee but a good indication that the code is platform independent.

MatthewHSE

12:12 pm on Aug 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have heard that eventually pages without doctypes will not render. If that's true, I expect it's a ways away.

Wow, if that's true, I would expect it to be at least ten years away. Actually I would be surprised if it ever happened. Imagine the first browser to come out that's so strict . . . would it ever achieve even 1% marketshare? Imagine 95% of websites simply not rendering at all; this is one that's going to take a ton of time to implement, because it will have to go clear through the educational process (getting webmasters to add the doctype), through development, and then through the enormous user-opposition. And all in all, I'm not sure requiring a doctype would make the Internet a better place. There's something to be said for a publishing medium that anyone can use without knowing special skills outside of their interest or expertise.

ronin

1:15 pm on Aug 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Providing an RSS feed arguably requires even fewer skills than publishing a web page... and RSS feeds which don't validate, don't work.

This is not a bad thing. Teaching people to write valid markup makes for a steeper learning curve at the beginning, sure, but adds up to far fewer compatibility headaches in the long run.

And, for those who use WYSIWYG editors, there should be no extra skill in adding a doctype and writing valid code - if the editor is correctly programmed this should happen automatically.

MatthewHSE

2:10 pm on Aug 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Right, but RSS is still fairly new. Therefore the RSS readers can afford to make a good start by not rendering invalid feeds. But with webpages its obviously a completely different matter. Sure, correctly-configured HTML editors will automatically add a doctype. How many are configured correctly out of the box, though? And, there are those who know a few HTML tags and prefer to design their pages by hand, but who never heard of a doctype and aren't likely to hear about one for a very long time. And finally, there are undoubtedly millions of webpages online, long-since forgotten by the designer, but still getting SE visits, etc.

I much prefer writing valid code complete with doctype; however, I believe there are so many pages without a doctype out there already that a browser that won't render those pages just isn't practical yet. Besides all the pages that will continue to be created without a doctype for years down the road yet . . .

In short, I understand and agree with everything you say, but I don't think it's going to happen any time soon if at all. Maybe I'm wrong; time will tell! ;)