Forum Moderators: not2easy

Message Too Old, No Replies

Doc type question - GoLive

Link to "http://www.w3.org/TR/html4/loose.dtd"? Why needed?

         

race2win

10:45 am on Nov 4, 2003 (gmt 0)



I recently started employing CSS throughout my websites.

I was using Adobe GoLive 6.0, but went back to using notepad as I learned CSS. Now I'm transitioning back to GoLive.

GoLive auto generates the following doctype declaration:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

While in notepad I had been using:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

When I transitioned my pages into GoLive, most of the pages had CSS problems and did not display properly, so I checked the code and that's when I noticed the difference between GoLive's declaration and what I had been using.

Adding the latter portion of the doctype declaration corrected the problems.

Being that I'm still a novice with CSS my question is why that extra declaration makes a difference?

I've alse seen the /strict.dtd and am not sure what the differences between these are - there are probably others?

Can anyone give me an explanation regarding Doctype declarations and CSS?

I'm sure others have been through the same learning curve I'm on. Any light anyone could shed on the subject is greatly appreciated.

Thanks!

victor

12:12 pm on Nov 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The absence of the second part triggers, in some cases, quirks mode: means the HTML is rendered differently.

This is Microsoft's attempt to explain it:

[msdn.microsoft.com...]

Best to always have a full DOCTYPE and thus not worry about quirks-mode rendering.

encyclo

2:54 pm on Nov 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



And here are the Mozilla pages describing standards mode vs. quirks mode:

[mozilla.org...]

and the list of doctypes which trigger each mode:

[mozilla.org...]

In short, quirks mode emulates the parsing errors older browsers, whereas standards mode (triggered by a full doctype) renders the pages in accordance (more or less!) with current standards. You are correct in using the full doctype in your example, as it enables standards mode in IE6 and an "almost-standards mode" in Mozilla/Netscape 6+.

The difference between a strict and a transitional doctype, is that the former does not include certain tags considered "deprecated" - that is, they should no longer be used. The strict doctype would enable full standards mode in Mozilla.