【问题标题】:Hiding scroll bar of a DIV隐藏 DIV 的滚动条
【发布时间】:2014-11-17 04:19:35
【问题描述】:

目前我正在使用以下代码来显示滚动条:

div.productsTree{
  height:300px;
  overflow:scroll;
}

使用此 CSS 时,滚动条始终可见,这意味着即使 div 内的内容不会溢出。

当内容符合上述高度时,如何隐藏它们?

【问题讨论】:

标签: css


【解决方案1】:

overflow:auto;。就是这样。

【讨论】:

    【解决方案2】:
    //Both x,y axis scroll
    div.productsTree{
      height:300px;
      overflow:auto;
    }
    
    //only x axis scroll
    div.productsTree{
      height:300px;
      overflow:auto;
      overflow-y: hidden;
    }
    
    //only y axis scroll
    div.productsTree{
      height:300px;
      overflow:auto;
      overflow-x: hidden;
    }
    

    【讨论】:

      猜你喜欢
      • 2015-03-16
      • 1970-01-01
      • 2012-10-26
      • 1970-01-01
      • 2017-05-29
      • 1970-01-01
      • 2013-03-01
      相关资源
      最近更新 更多