在不同的浏览器中,滚动条总是具有相同的宽度吗? [英] Are scroll bars always the same width in different browsers?
问题描述
我需要进行CSS调整以补偿滚动条。所以我想知道 - 在不同的浏览器和操作系统中滚动条总是相同的宽度?
I need to make a CSS adjustment to compensate for a scroll bar. So I was wondering- are scroll bars always the same width in different browsers and operating systems?
我有两个表,一个在另一个之上,到百分比)。一个表需要一个滚动条,所以我想在上面的表中添加另一个列,以补偿它,所以列排列。
I have two tables, one above the other, with matching columns widths (set to percentages). One table needs a scroll bar, so I want to add another column in the table above it to compensate for it, so the columns line up.
推荐答案
SWEET!这里有一个解决方案,任何人谁有同样的问题。这应该是跨浏览器兼容太。
SWEET!Here's a solution for anyone who has this same problem. This should be cross-browser compatible too.
只要在顶部表格中添加一个滚动条,使用一些额外的CSS隐藏它们。
Just add a scroll bar to the top table as well, with some extra CSS to hide them.
#topTable{
overflow: scroll;
padding-right: 16px;
padding-bottom: 16px;
margin-right: -16px;
margin-bottom: -16px;
}
在理论上,你所要做的就是16px所以你可以做同样的效果:
In theory, all you have to do is make the "16px's" match, so you can do this with the same effect:
#topTable{
overflow: scroll;
padding-right: 100px;
padding-bottom: 100px;
margin-right: -100px;
margin-bottom: -100px;
}
这篇关于在不同的浏览器中,滚动条总是具有相同的宽度吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!