960 网格在 Internet Explorer 中左对齐

发布于 2024-08-01 13:20:04 字数 586 浏览 3 评论 0原文

我在网站上使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

谁与争疯 2024-08-08 13:20:04

您需要在 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.

叹梦 2024-08-08 13:20:04

需要注意的是,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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文