css – 隐藏滚动条(CSS – Hide scroll bar)

css – 隐藏滚动条

chrome

.tabs::-webkit-scrollbar {
  width: 0px;
  height: 0px;
}

ie

// 此更改允许在容器上滚动并隐藏IE上的条.
.container{
    -ms-overflow-style: none;
}

margin 负值

body { margin-right: -15px; margin-bottom: -15px; }

原理:这会在margin的水平和垂直方向上添加一个负值, IE添加了该精确数值后, 便会去除对滚动条的需求假象.
优点:在视觉上解决了这个问题.,垂直滚动根据内容自适应
缺点:由于”人为创建”了15px的外边距(margin), 所以无法使用该填充过的屏幕区域.

————————

CSS – Hide scroll bar

chrome

.tabs::-webkit-scrollbar {
  width: 0px;
  height: 0px;
}

ie

// 此更改允许在容器上滚动并隐藏IE上的条.
.container{
    -ms-overflow-style: none;
}

margin 负值

body { margin-right: -15px; margin-bottom: -15px; }

Principle: this will add a negative value in the horizontal and vertical directions of margin. After ie adds the exact value, it will remove the illusion of demand for scroll bars
Advantages: it solves this problem visually, Vertical scrolling adapts to content
Disadvantages: because the margin of 15px is artificially created, the filled screen area cannot be used