a problem with CSS and MicroSoft Internet Explorer

Good morning,

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">
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<title>html 1.01 or 4.01 ?</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<table width= "200" summary="xyw">
<tr>
<td>table</td>
</tr>
</table>
</body>
</html>

and my "style.css" is:

body {
 background: #00cc00; color: #000000;
}
table {
 margin-left: auto; margin-right: auto; background: #ffddff;
}

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:

Tidy (vers 30th April 2000) Parsing "xxxxx.htm"
"xxxxx.htm" appears to be HTML 4.01 Transitional
no warnings or errors were found

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!...

Note:
====
I haven't this problem with Netscape 6.2 or Opera 6.0.

How do you understand this phenomenon? What's the remedy? What must I do?

Thanks in advance.

Yours Sincerely.


Jean-Claude Grégoire
12120 Rulhac-St-Cirq
France

Received on Wednesday, 13 March 2002 17:02:04 UTC