开发者

Firefox hides vertical scrollbar if element's height is less than 32px

in FF3 (3.0.14) I'm seeing an issue where the vertical scrollbar is hidden on an element if its height is less than 32px. In my (much simplified) example below, the scrollbar doesn't appear on "shouldScroll" - even though its child is larger than it - until I increa开发者_运维技巧se its height. Does anyone know if this is a known issue with particular versions of FF, and/or if any workarounds exist?

Cheers, Alasdair

P.S. sorry about the formatting, if someone could tell me how best to embed html in my post it'd be much appreciated

<html>
<head>
</head>
<body>
<div id="shouldScroll" style="height: 20px; overflow: auto; background-color: red">
<div id="child" class="popupText" style="width: 100px; height: 100px;">Run Test</div>
</div>
</body>
</html>


I'm not a web developer but noticed 32 which is something of a magic number when dealing with images. The two buttons on the scrollbar are likely 16 pixels tall. I imagine Firefox is hiding the scroll bar when the client area size is less than the size of the two buttons.

Sorry, no idea about how to fix your actual problem.


Known bug (https://bugzilla.mozilla.org/show_bug.cgi?id=292284, Atoms is right it's done when the scroll buttons don't fit), and I'm not aware of any workarounds.


Trevor's answer is right. To see the scrollbar, just add some height to the outer div.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜