Forum Moderators: open

Message Too Old, No Replies

DOCTYPE question

         

Jon_King

7:27 pm on Jul 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I do not understand the doctype tag or declaration... Here is an example on a page I've been asked to work with:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0039)http://www.etisystems.com/etibanner.htm -->

What's up with this? Any explanation greatly appreciated.

Nick_W

7:54 pm on Jul 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here's a reasonable explanation: [w3.org ]

Basically the DOCTYPE does what it says, tells the user agent the type of document to expect. Very important if you use css for positioning as not declaring a doctype puts ie6 into 'quirks' mode. Meaning it may not understand some of your code.

There are further implications but I'll leave that to someone else ;)

Nick

creative craig

7:58 pm on Jul 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This means that the HTML in the document is version HTML 4.01 Transitional, a standard implemented by the W3C. Every time the web page is requested by a web browser it looks at the DOCTYPE and can then expect the rest of the page to be HTML 4.01 Transitional.

P.S
This may seem realy silly but what does Quirks mode actualy mean, I have heard it alot on this forum and I am not sure of what it means?

Nick_W

8:28 pm on Jul 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



IE5 doesn't understand the box model in css (borders, widths, padding etc.) It's a little complicated....

If you don't specify a doctype on the first line of your html documents then IE6 (which understands better) will behave like IE5.

Nick

ergophobe

8:35 pm on Jul 30, 2002 (gmt 0)

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




what does Quirks mode actualy mean

It means that IE6 behaves as though it were IE5 rather than conforming to common standards. The classic example is the "box model" When you create a <div> with say a specified width, IE5 calculates it "incorrectly" based on the CSS recommendation. If you add a DOCTYPE, IE6 will size the box as per the standard. If you leave the DOCTYPE off, it will size it as IE5 would. For more info, try this

[google.com ]

moonbiter

8:35 pm on Jul 30, 2002 (gmt 0)

10+ Year Member



Also see: [webmasterworld.com...]

creative craig

8:53 pm on Jul 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for that, I understand what you mean now. I have a laptop with IE6 and my parents have a PC with IE5, and I have noticed differences that before hand I havent been able to explain in the past.