ul {
list-style: none;
width:300px;
margin:100px auto;
height:100px;
display: -webkit-box;
white-space: nowrap;
overflow: hidden;
-webkit-backface-visibility: hidden;
-webkit-perspective: 1000;
-webkit-overflow-scrolling: touch;
text-align: justify;
overflow-x: initial;
}
li {
width:100px;
height:100px;
line-height: 100px;
text-align: center;
background-color: #1b961b;
border:1px solid;
}
@media only screen and (max-width: 768px){
ul {
width:100%;
}
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 0
在移动端使用,主要看ul上的属性
css超出盒子隐藏
效果如图1-1. 效果图1-1 css代码: white-space: nowrap;overflow: hidden; text-overflow: ellipsis; display: inlin ...
小tip:纯CSS让overflow:auto页面滚动条出现时不跳动