【问题标题】:scroll bar going out at the bottom from the parent div滚动条从父 div 底部出来
【发布时间】:2012-06-15 07:43:56
【问题描述】:

当我将 padding:10px 应用于高度为 100% 且父高度为 200px 的子 div 时,当内容超过高度的 200px 时,滚动条底部将向外移动。如果我删除填充它会很好。如何在不移除填充和添加到 div 的情况下解决问题?

http://jsfiddle.net/H2d77/

【问题讨论】:

    标签: css


    【解决方案1】:

    overflow:auto;.wrapper

    .wrapper{height:200px;width:300px; overflow:auto; border:1px solid red;margin:10px}
    
    .innerDiv{height:100%;padding:10px}
    

    演示:http://jsfiddle.net/H2d77/4/

    【讨论】:

    猜你喜欢
    • 2014-12-12
    • 1970-01-01
    • 2017-12-27
    • 2012-07-30
    • 1970-01-01
    • 2012-07-13
    • 2010-09-21
    相关资源
    最近更新 更多