如何让页面在 Chrome 和 IE 中显示相同的内容?
求救!我的页面可以在 chrome、Firefox 和 safari 中正常显示。但在 Internet Explorer 中,它看起来非常糟糕。谁能告诉我需要更改哪些内容才能使 IE 显示的页面与 Chrome 显示的页面相同?这听起来可能真的很愚蠢,但我真的需要帮助。
SOS! I have a page that will display well in chrome, Firefox, and safari. But in Internet Explorer it looks absolutely terrible. Can anyone show me what needs to be changed so IE displays the page the same as Chrome displays it? This is probably sounding really stupid but I really need help here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你那里有很多问题。我第一眼看到的几个问题:
bgcolor
和align
已弃用,可能还有其他。margin: 0 auto;
来使其居中。相反,您应该将其应用于容器内的 div。这就是为什么它不以 IE 为中心。 IE 在技术上是正确的; Webkit 正在补偿错误。可能还有更多,但这些是最明显的。我强烈建议您重新开始此页面;从现代样板开始并从那里构建它。
You've got a lot of issues there. A few issues I see from first glance:
bgcolor
andalign
are deprecated, there might be others.margin: 0 auto;
on your container div to center it. Instead, you should be applying that to a div inside the container. That's why it's not centering in IE. IE is being technically correct; Webkit is compensating for the error.There's probably more but those are the most obvious. I'd highly recommend you start this page again; begin with a modern boilerplate and build it up from there.