views:

1008

answers:

4

I'm using the 960.gs CSS framework on a site and have hit problems almost instantly with IE (7, though I assume 6 is no better).

<html>
<head>
    <link rel="stylesheet" href="design/reset.css" />
    <link rel="stylesheet" href="design/960.css" />
    <link rel="stylesheet" href="design/text.css" />
</head>
<body>
    <div class="container_12">abc</div>
</body>
</html>

Given this HTML above (the CSS is just the files bundled with 960), Firefox and Chrome centre the grid, whereas IE pushes it to the left.

I've used 960 before without any issues, so I think I must just be doing something really stupid. Can anyone help?

+5  A: 

You need to include a DOCTYPE at the beginning of your HTML, otherwise the CSS won't come out right in IE. You can use the one from the demo file that came with the 960 package.

great_llama
Thanks! `<!DOCTYPE html>` was all it took. Bizarre, but true.
nickf
Worked for me too. Thanks!
tk-421
Worked here as well. Thanks!
Justin
A: 

Thanks, this helped solve my problem!

Alex Lee
A: 

Thanks for question and answer!

DevLism
A: 

Thank you!

It should be noted that there can not be anything in front of the DOCTYPE-tag.

For example, the default Netbeans HTML-template has a few lines of HTML comments before DOCTYPE, so be sure to delete that in order to get 960.gs to work.

Patrick