Forum Moderators: mack

Message Too Old, No Replies

Half!DOCTYPE Declaration

What is it exactly, and why should it be used?

         

koocw

7:34 am on Apr 2, 2004 (gmt 0)

10+ Year Member



What exactly is the half!DOCTYPE declaration and why should anybody want to use it?

victor

8:39 am on Apr 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



To trigger -- or not -- quirks mode in IE:

[msdn.microsoft.com...]

ara818

9:15 am on Apr 3, 2004 (gmt 0)

10+ Year Member



Well, if you'd like to know exactly what a doctype declaration is, it is a tag put at the top of html pages to tell browsers what kind of HTML you will be using for this page.

You see there is HTML 3.2, HTML 4.0 Transitional, HTML 4.0 Strict, XHTML 1.0 Transitional, XHTML 1.0 Strict, XHTML 1.1, well, anyway there are lots of different html languages you could use.

If you don't put a DOCTYPE declaration on your page, the browser will do it's best to display the html you give it, if you do put a DOCTYPE the browser will use that information and it may affect how the page's html is displayed. Anyway the link from the previous reply talks more about that.

Hope this made sense.

isitreal

5:25 pm on Apr 3, 2004 (gmt 0)

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



The half doctype also triggers a certain kind of quirks behavior in the earlier Mozilla's, Netscape 6.2, maybe 7.0, Mozilla 1, which is very useful in certain cases because those earlier Mozillas had certain bugs that only manifested in full doctype declarations, layout type stuff.

bird

6:43 pm on Apr 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



An incomplete DOCTYPE declaration (which I assume is what you're talking about here) is technivally equivalent to having no such declaration at all. If you want to trigger old browser bugs, just leave it away. There's no poing in adding a line of text to your pages that doesn't do or mean anything.

isitreal

6:47 pm on Apr 3, 2004 (gmt 0)

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



Your pages will validate with an incomplete doctype, which in itself is not that meaningful, but does give you the ability to use validation services without having to fake the doctype.

bird

8:33 pm on Apr 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's really a bug in the validator, but ok, I see the practical point... ;)