html - div 的高度随缩放级别而变化

标签 html css scaling

在我的网站主页上,我有两列,每列包含不同数量的元素。两列的高度加起来为 410 像素,但是,根据浏览器的缩放级别,两列的底部可能不会对齐。它似乎在 Chrome 中最为明显,而在 Firefox 中根本没有出现。

我能做些什么来解决这个问题吗?

有问题的页面是http://goo.gl/mHU3A , 页面底部。

最佳答案

我不确定为什么 Chrome 会这样做(正如您所说,高度都等于 410 像素),但是您可以做的一个“技巧”是添加以下代码(到您的 css):

.test-home { position: relative; }
.test-home .home-new-tutorial-all {
    position: absolute; /* forces it to sit in a specified position */
    bottom: 0; /* don't worry about a left/right, as all we're concerned with is making it sit at the bottom */
    width: 100%; /* required, otherwise it fits to the text-width only */
}

这将强制 .home-new-tutorial-all 类位于底部,无论浏览器的缩放比例如何。它使“After Effects Pt 2 脚本编写”和本教程链接之间的边距/空间变大了一点,但鉴于此链接是不同的样式,您可以说它是故意的。

抱歉,这不是 Chrome 行为异常的原因,但希望此修复适用:)

祝你好运!

关于html - div 的高度随缩放级别而变化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11387267/

相关文章:

html - 隐藏状态栏上的 anchor 显示

html - 仅在 chrome 中突出显示按钮边框的问题

android - hdpi 资源不再加载

html - 如何使表格响应? (堆栈列)

css - SVG 不能用 CSS 缩放

android - 为密度和屏幕尺寸创建可绘制对象?

jquery - 如何在密码字段中放置文本水印?

html - 斜丝带的制作方法

c# - 在 .NET 中从 URI 到图像

javascript - 如何用按钮制作标题标题