zjffun blog

CSS 隐藏滚动条

更新于 写于 前端

SCSS:

scss
%hide-scroll-bar {
  &::-webkit-scrollbar {
    display: none; /* webkit */
  }
  -ms-overflow-style: none; /* IE 11 */
  scrollbar-width: none; /* Firefox 64 */
}

.article {
  @extend %hide-scroll-bar;
}

CSS:

css
.article {
  -ms-overflow-style: none;
  /* IE 11 */
  scrollbar-width: none;
  /* Firefox 64 */
}
.article::-webkit-scrollbar {
  display: none;
  /* webkit */
}