960 网格在 Internet Explorer 中左对齐
我在网站上使用 960.gs CSS 框架,并且几乎立即在 IE 上遇到问题(7,尽管我假设 6 也好不了)。
<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>
鉴于上面的 HTML(CSS 只是与 960 捆绑的文件),Firefox 和 Chrome 将网格居中,而 IE 将其推到左侧。
我以前用过960,没有任何问题,所以我想我一定是做了一些非常愚蠢的事情。 有人可以帮忙吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要在 HTML 的开头包含 DOCTYPE,否则 CSS 将无法在 IE 中正确显示。 您可以使用 960 软件包附带的演示文件中的文件。
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.
需要注意的是,DOCTYPE标签前面不能有任何内容。
例如,默认的 Netbeans HTML 模板在 DOCTYPE 之前有几行 HTML 注释,因此请务必将其删除以使 960.gs 正常工作。
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.