div
<h2>请注意需要在移动端预览,PC端拖拽无效果</h2> <div class="box"> <span style="flex: 1;">保障类型</span> <p class="item"> <span>标签1</span> <span>标签2</span> <span>标签3</span> <span>标签4</span> <span>标签5</span> <span>标签6</span> <span>标签7</span> <span>标签8</span> <span>标签9</span> <span>标签10</span> <span>标签11</span> <span>标签12</span> <span>标签13</span> <span>标签14</span> <span>标签15</span> <span>标签16</span> <span>标签17</span> <span>标签18</span> <span>标签19</span> <span>标签20</span> <span>标签21</span> <span>标签22</span> <span>标签23</span> <span>标签24</span> <span>标签25</span> <span>标签26</span> <span>标签27</span> <span>标签28</span> </p> </div>
css
.box { width:600px; height:40px; overflow-y:hidden; overflow-x:auto; white-space:nowrap; margin:100px; background-color:aqua; } .box::-webkit-scrollbar { display:none; } .item { width:384px; height:216px; display:inline-block; }