Remove scollbar when no need to scroll

后端 未结 1 1854
我寻月下人不归
我寻月下人不归 2021-01-20 12:54

I have a div with a scollbar as a result of the CSS below. However, when there is no need to scroll, the bar is still there. There is no slider/arrows, but an

相关标签:
1条回答
  • 2021-01-20 13:24

    use

    overflow: auto;
    

    then overflow will only be displayed if it actually overflows

    auto The behavior of auto isn’t specified in any detail in the CSS2.1 specification. In existing implementations it provides scrollbar(s) when necessary, but it doesn’t show scrollbars unless the content overflows the element’s box.

    http://reference.sitepoint.com/css/overflow

    0 讨论(0)
提交回复
热议问题