PDA

View Full Version : Are <!DOCTYPE> tags important?


rubber30
09-05-2002, 10:31 PM
I commonly see tags that start a web document as follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


is it important to add these when authoring documents?

austinrock000
09-06-2002, 04:03 PM
I'm not sure how much of a help they actually are, but I can tell you that they aren't neccessary. I never had them in my webpages until I started using FirstPage

Melysa
09-06-2002, 04:43 PM
Well, I read that W3C would like you do use this because it tells the browser which version of HTML is used on your page. But...most people ignore it because most browsers "don't care". Anyway, I used it for years and found it not effective (well, not NOW anyway).

Giz
09-07-2002, 04:40 AM
Well many browsers may not care but it's good to be w3c compliant with your code (that said I haven't got it in my pages but they're being re-done anyways). They were more important when Netscape was more twitchy if I remember right but since then the boffins at NetscapeHQ have made that piece of code slightly obsolete.

boris
09-07-2002, 04:44 AM
A funny think I noticed is that the default <!Doctype> tag FirstPage2000 creates is not W3C compliant (at least last time I checked).

austinrock000
09-07-2002, 06:25 AM
LOL. I never really checked it to see if it was, I just left it there.

EnwTheGood
09-07-2002, 07:47 PM
I think the whole idea of DTDs is a bit confusing. For example, the "Strict" and "Transitional" sets of XHTML should, in my opinion, be separated into two distinct languages or have their differences defined within the syntax (that is, functionality of both could be mixed within one document with a tag attribute)

-TheDarkEye-
09-07-2002, 08:23 PM
to everyone who thinks doctypes dont make a diff... try loading your fav css driven page with several variations of the doctype. i think you will be very supprized at the results.

both the newest verison of ie and netscape/mozilla use doctypes.

-TheDarkEye-
09-07-2002, 08:44 PM
likewise for ie. sorry, i dont feel like putting myself through the agony of finding the page on msdn that describes all the doctype stuff for ie.

-TheDarkEye-
09-07-2002, 08:50 PM
so are you gona stop posting now? lol

Josh
09-07-2002, 08:57 PM
Congratulations!Posting doesn't seem hard on you.
wana see your new site soon:D

-TheDarkEye-
09-07-2002, 09:05 PM
i cant say ive ever heard of someone becoming a mod in one day... good luck with that.

Admin
09-07-2002, 09:10 PM
Hello, could you please re-PM me. I had private messaging disabled by default so I never received your message. (stilly old me) :rolleyes:

Originally posted by dbindel
lol, yeah i know. but the forum is new and sooner or later Admin will need help. i'm here whenever that time comes around, and i've been very active so far.

EnwTheGood
09-08-2002, 06:42 AM
So if Transitional is a superset of Strict, why doesn't everyone just use Transitional?

EnwTheGood
09-08-2002, 06:51 AM
Wow, that Quirks page is an interesting read. I never realized those modes existed. If the Moz Quirks mode exists to make pages more compatible with IE (in effect), then what does the IE quirks mode do?

EnwTheGood
09-08-2002, 04:00 PM
I think it's rather interesting that the group that makes the standards makes standards designed to be not compliant with the standards they made for standardization's sake.

In other words, the fact that there IS an official transitional DTD shows you something, doesn't it?

dabbler
09-13-2002, 03:14 AM
I read that the need for standardization came about because of the new "user agents" being used to access the net: mobiles, tv etc.
Because the browsers used need to be much more compact, there is no room for the huge IE type browser that will try to make sense of our sloppy coding. Therefore if our coding is streamlined and standardized it will be compliant with the new technology.

But it seems that M$ and Netscape etc have not yet fully implemented XML based coding (and CSS2) so there has to be a little 'backward compatability' - hence "Transitional".

Delicates
09-15-2002, 06:17 PM
Mozilla (and any other browser based on Gecko engine, like Netscape, Compuserve and AOL) actually has 3 different rendering modes: Standards, Almost Standards and Quirks mode.
This page (http://www.mozilla.org/docs/web-developer/quirks/doctypes.html) describes what DOCTYPE declarations trigger these modes.

IE has 2 modes which are triggered depending (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnie60/html/cssenhancements.asp) on DOCTYPE declaration.


The purpose of these modes is either rendering the page properly (in standards-compliant mode), or in the way legacy browsers rendered it (quirks mode) as to not break old pages.

If you are not including DOCTYPE (http://www.w3.org/TR/html4/struct/global.html#h-7.2) declaration in your document - basically what you are creating is not valid HTML.

Sky
09-19-2002, 10:53 AM
Man... so where in the world do i figure out HOW to rate mine?

Delicates
09-19-2002, 02:21 PM
Originally posted by Sky
Man... so where in the world do i figure out HOW to rate mine?

Yours most likely will be Transitional. For if you were able to create Strict documents, you wouldn't be asking this question.

You can validate your pages here:

HTML Validator (http://validator.w3.org/)

CSS Validator (http://jigsaw.w3.org/css-validator/)

Waves
09-19-2002, 06:24 PM
I used to use them, but eventually took them out. It didn't affect my website at all. It just used up an extra line of space that looked ugly. I needed the 50 bytes of webspace.

Sky
09-20-2002, 11:36 AM
Thanks del... I'll check em out. And waves, I guess you're glad about this hosting deal.