【问题标题】:padding-top causes bottom of scrollbar to disappear in FFpadding-top 导致滚动条底部在 FF 中消失
【发布时间】:2012-03-13 03:23:33
【问题描述】:

我在我的 HTML 页面中配置了以下 DIV:

<div id="contentDiv" style="padding-top: 20px; padding-left: 20px; overflow: auto; height: 100%;" >

内容足够大,需要垂直滚动条。 在 IE 中,页面看起来不错。但是,在 FF 中,滚动条的底部会溢出页面底部的 padding-top 设置量(即 20 像素)。有没有办法保持填充顶部并在 FF 中显示完整的滚动条?谢谢。

【问题讨论】:

    标签: css firefox scrollbar padding


    【解决方案1】:

    如果 IE 版本低于 8 无关紧要,您可以使用 box-sizing: border-box 在块尺寸中包含填充。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-06-05
      • 2014-12-12
      • 1970-01-01
      • 1970-01-01
      • 2012-10-22
      • 2011-11-13
      • 2023-03-25
      • 1970-01-01
      相关资源
      最近更新 更多