html - CSS 布局困难,站点在 chrome 中表现良好,但在 Firefox 中表现不佳

标签 html css firefox google-chrome positioning

我在使用该站点时遇到跨浏览器问题,有人可以向我解释为什么它在 Firefox 中不起作用,但在 google chrome 中可以吗?

单击图像时,文本在 Firefox 中的位置不正确

http://dl.dropbox.com/u/2306276/problem/index.html

我觉得有关系

display: table;

但我不知道为什么。

谢谢

最佳答案

更改 CSS 的这些部分:

div.container {
    height: 215px;
    line-height: 215px;
    width: 215px;
    text-align: center;
}

div.child {
    display: inline-block;
    margin: 0;
    position: relative;
    vertical-align: middle;
}

通常情况下,尽可能避免使用 display: table-* 会更安全。

关于html - CSS 布局困难,站点在 chrome 中表现良好,但在 Firefox 中表现不佳,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7944398/

相关文章:

javascript - CSS 背景图片,加载后淡入淡出

python - Selenium:页面显示不同

html - Firefox 表格边框打印 2px 将边框呈现为 1px

java - 如何使用FirefoxProfile通过Firefox浏览器自动下载?

iframe src 中的 JavaScript 函数

html - Flexbox 强制新列

javascript - 嵌套表单上的提交按钮在 IE7 中提交外部表单

css - 禁止将字体渲染为表情符号

jquery - 选择第一个有适当类(class)的 child

html - 组件交互 2 向 Angular