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

在我的网站主页上,我有两列,每列包含不同数量的元素.两列高度总计达410px,但是,根据浏览器的缩放级别,两列的底部可能不对齐.它似乎在Chrome中最为明显,并且在Firefox中根本不会出现.

我有什么办法可以解决这个问题吗?

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

最佳答案 我不确定为什么Chrome会这样做(正如你所说,高度都等于410px),但你可以做的一个“黑客”是添加以下代码(给你的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表现奇怪的原因,但希望这个修复是合适的:)

祝好运!

点赞