tags:

views:

35

answers:

2
<!DOCTYPE html>

<html land="en">
<head>
<title></title>
<style>
#container { margin: 0 auto; width: 960px; }
</style>
</head>
<body>
<div id="container"></div>
</body>
</html>

How can I get this to work in Internet Explorer without changing the doctype?

A: 

The container needs some height. Set a height or put some text inside. Should be consistent everywhere.

meder
+2  A: 

Easy

body {
  text-align: center;
}

#container {
  text-align: left;
}
Ben Rowe
This should only be a quirks mode fix. The document is in standards mode because of the HTML 5 DTD. I don't get why you need this, unless you really meant to center the TEXT. The element itself is centered. Example: http://medero.org/drop.html
meder
Agreed @meder. That was my thought yesterday when I saw this, but didn't have time to test it.
Bryan Downing