Css 隐藏DIV的滚动条

Css 隐藏DIV的滚动条,css,Css,目前,我正在使用以下代码显示滚动条: div.productsTree{ height:300px; overflow:scroll; } 使用此CSS时,滚动条始终可见,这意味着即使在div中的内容没有溢出时 当内容符合上述高度时,如何隐藏它们?使用溢出:自动。仅此而已。带有溢出:自动。仅此而已。可能的重复 //Both x,y axis scroll div.productsTree{ height:300px; overflow:auto; } //only x axi

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

div.productsTree{
  height:300px;
  overflow:scroll;
}
使用此CSS时,滚动条始终可见,这意味着即使在div中的内容没有溢出时


当内容符合上述高度时,如何隐藏它们?使用
溢出:自动。仅此而已。

带有
溢出:自动。仅此而已。

可能的重复
//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;
}