Hiding the scroll bar on an HTML page

前端 未结 21 1398
旧巷少年郎
旧巷少年郎 2020-11-22 00:07

Can CSS be used to hide the scroll bar? How would you do this?

21条回答
  •  失恋的感觉
    2020-11-22 00:43

    My HTML is like this:

    Add this to your div where you want to hide the scrollbar:

    .content {
      position: absolute;
      right: -100px;
      overflow-y: auto;
      overflow-x: hidden;
      height: 75%; /* This can be any value of your choice */
    }
    

    And add this to the container

    .container {
      overflow-x: hidden;
      max-height: 100%;
      max-width: 100%;
    }
    

提交回复
热议问题