如何使该页面在 IE 9 上居中

发布于 2024-11-24 19:40:26 字数 128 浏览 5 评论 0原文

我有一个小问题这里,这个页面在firefox、opera、chrome上已经居中,但是在IE 9上此页仍在左侧..寻求帮助....

i have a little problem here, this page at firefox, opera, chrome, has already center, but at IE 9 this page still at left.. tq for help....

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

逐鹿 2024-12-01 19:40:26

首先,您需要将宽度更改为小于 100%

然后您需要更改

margin-top: 50px;
margin-left: 0 auto;
margin-right: auto;

margin: 50px auto 0;

,它应该可以工作。

编辑

我应该仔细看看!

我还会更改您的 .container。给 width:auto; 一个固定宽度,例如 900px

http://jsfiddle.net/jasongennaro/yj7mu/3/

First you need to change your width to something less than 100%

Then you need to change

margin-top: 50px;
margin-left: 0 auto;
margin-right: auto;

to

margin: 50px auto 0;

and it should work.

EDIT

I should have taken a closer look!

I would also change your .container. Give width:auto; a fixed width, 900px for example.

http://jsfiddle.net/jasongennaro/yj7mu/3/

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