W3C home > Mailing lists > Public > html-tidy@w3.org > January to March 2002

Re: a problem with CSS and MicroSoft Internet Explorer

From: Klaus Johannes Rusch <KlausRusch@atmedia.net>
Date: Sun, 10 Mar 2002 20:28:22 CET
Message-Id: <200203102002.PAA11850@tux.w3.org>
To: Jean-Claude Grégoire <a-altair@wanadoo.fr>
Cc: <html-tidy@w3.org>
In <001301c1c638$1887b660$88d9f8c1@2>, =?iso-8859-1?Q?Jean-Claude_Gr=E9goire?= <a-altair@wanadoo.fr> writes:
> I have a problem with CSS and MicroSoft Internet Explorer.
> If my html file (xxxxx.htm) is:
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 1.01 Transitional//EN">
> ...
> MSIE (vers. 6.0), Netscape (vers. 6.2) and Opera (vers. 6.0) understand that
> perfectly and give me a "rose table" in the center of a green page.
> 
> Then I test my html file with Tidy. Result:
> ...
> As a result, I follow the advice of TIDY and I change the text of the line
> #1 of my html file to this one :
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> 
> Now MS Internet Explorer (vers 6.0) doesn't understand the code:
> "margin-left: auto; margin-right: auto;"
> any more, and my rose table goes to the left side of the screen!...

MSIE 6 uses doctype switching, if a well-known doctype is presented the browser
renders the page following that standard, otherwise it tries a "best guess"
method.

Since your original doctype declaration

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

refers to a non-standard doctype, MSIE used proprietary attributes, with the standard

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

doctype, rendering reverts to standards compliant.

See <URL:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnie60/html/cssenhancements.asp> for details.

-- 
Klaus Johannes Rusch
KlausRusch@atmedia.net
http://www.atmedia.net/KlausRusch/
Received on Tuesday, 12 March 2002 00:05:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 April 2012 06:13:51 GMT