美文网首页
css white-space: nowrap 实现横向滚动

css white-space: nowrap 实现横向滚动

作者: 麻辣小面瘫 | 来源:发表于2019-03-19 10:34 被阅读0次

nowrap: 文本不会换行,文本会在在同一行上继续,直到遇到
标签为止。

实现:

<div style="width: 600px; height: 100px;white-space: nowrap; overflow: auto;font-size: 0;">
  <div style="width: 200px; height: 80px;background: #999;display:inline-block;margin-right: 10px;"></div>
  <div style="width: 200px; height: 80px;background: #999;display:inline-block;margin-right: 10px;"></div>
  <div style="width: 200px; height: 80px;background: #999;display:inline-block;margin-right: 10px;"></div>
  <div style="width: 200px; height: 80px;background: #999;display:inline-block;margin-right: 10px;"></div>
</div>

相关文章

网友评论

      本文标题:css white-space: nowrap 实现横向滚动

      本文链接:https://www.haomeiwen.com/subject/hpawmqtx.html