在我的网站主页上,我有两列,每列包含不同数量的元素。两列的高度加起来为 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/