元素超出出现左右或者上下滚动
1 <div class="box"> 2 <span>1</span> 3 <span>2</span> 4 <!-- ... --> 5 </div> 6 7 css: 8 9 .box{ 10 max-width: 76%; 11 text-align: right; 12 overflow-x: auto; //左右滑动 13 white-space: nowrap; //使其不换行 14 } 15 .box span{ 16 display: inline-block; 17 margin-left:10px 18 } 19 /*去除滚动条*/ 20 .box::-webkit-scrollbar{ 21 display:none; 22 }