Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

960 Grid aligns left in Internet Explorer

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?

like image 377
nickf Avatar asked Aug 17 '09 01:08

nickf


2 Answers

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.

like image 71
great_llama Avatar answered Sep 24 '22 00:09

great_llama


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.

like image 23
Patrick Avatar answered Sep 24 '22 00:09

Patrick