The suggested solution to the problem of visible scrollbars does not work in the below scenario :

针对可见滚动条问题的建议解决方案在以下方案中不起作用:

JSFIDDLe

CSS:

#hider {
    position:absolute;
    top: 0;
    left:0;
    height: 400px;
    width: 200px;
    background-color: green;
    overflow: hidden;
}

#scroller {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    padding-right: 20px;
    padding-bottom: 20px;
    overflow: auto;
}

#content {
    float: left;
    height: auto;
    width: auto;
}

HTML:

<div id="hider">
    <div id="scroller">
        <div id="content">
            xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
            <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        </div>
    </div>
</div>

The problem I'm having is that the width of <div id="content"></div> cannot be known beforehand in my case, that's why I need to set it to auto.

我遇到的问题是,在我的情况下,无法事先知道

的宽度,这就是我需要将其设置为auto的原因。

更多相关文章

  1. 两个并列的div,一个确定宽度一个自动调整
  2. 如何让我的固定宽度移动网站始终显示“完全放大”?
  3. HTML5用户身份认证源代码:注册、登录、会话保持的解决方案
  4. CSS3列 - 添加第二个元素后的额外宽度
  5. 如何使用“left:100%”CSS规则保留DIV宽度
  6. 使三个标签填充容器的宽度
  7. 用于在表中强制换行的PHP或HTML/CSS解决方案
  8. PHP选择具有特定宽度的图像并构建网格
  9. 如何实现分布式文件上传解决方案?

随机推荐

  1. 当月的开始和结束日期
  2. Windows中结束占用某个端口的进程
  3. 程序员的发展方向有哪些
  4. 学习流行的JavaScript框架20120727-[jQue
  5. 《你不知道的JavaScript
  6. Java-子类和父类的几种关系
  7. 准备语句SQL异常“无输入参数”
  8. 低延迟系统的Java实践
  9. java基础:集合框架之Map(共性方法)
  10. Java正则表达式