水平对齐在 Firefox 和 IE 中不起作用
我的网站似乎在 Google Chrome 上完美运行,但在 Firefox 或 IE 中查看时,对齐方式完全尴尬。有人可以帮我解决这个问题吗? 提前致谢。
该网站的链接是:
firefox/IE 的问题是 3 个框没有在中间对齐。 就像在铬中一样,它与中心对齐,这正是我想要的。
问候
My site seems to perfectly runnning on Google Chrome but when it is viewed in Firefox or IE, The alignment it completely awkward. Can somebody please help me sort this issue.
Thanx in advance.
The link to the website is :
The problem with firefox/IE is that the 3 boxes are not aligned in the middle.
where as in chrome it is aligned to the center which is exactly what i want.
Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你的内容框是内联块的;并向左浮动。
使其块
display:block
,对齐到中心margin:0 auto;
并删除浮动。我认为这应该有帮助。
其他盒子也一样
your content box is inline-block; and is floated left.
make it block
display:block
, align to the centermargin:0 auto;
and remove float.I think this should help.
and same for other boxes as well
您遇到了打开/关闭 div 嵌套错误的情况。
您需要注释掉注释后的
。
当 HTML 出现问题时,每个浏览器都会尝试修复它,但采用的是非标准化的方式。
You have a case of bad nesting of opening/closing divs.
you need to comment out the
</div>
after thecomment.
When there are problems in your HTML, each browser will attempt to fix it, but in a non standardized way.
如果您将 style.css 中的
#frontcontent-container
规则减少为:这样就可以解决问题。问题是你向左浮动并显示为内联块。另外,您似乎将样式表包含了两次。
哦,您的标记似乎存在一些问题 - 包装器 div 实际上根本没有包装太多,所以我假设您在某处缺少结束标签!
if you reduce the
#frontcontent-container
rule in style.css to just read:that should do the trick. the problem is you're floating left and displaying as inline-block. Also, it seems you're including the stylesheet twice.
Oh and there seems to be some problems with your markup - the wrapper div doesn't actually wrap much at all, so i assume you're missing a closing tag somewhere!