相关疑难解决方法(0)

如何在页面上进行水平滚动

我有div,其中放置内部div我需要使所有内部div在行和水平滚动条应显示(我知道这听起来很疯狂,但我需要).我尝试了容器宽度自动和溢出滚动但没有.

怎么做到这一点?

我的加价:

   <!DOCTYPE html>
<html>
 <head>
  <meta charset="utf-8">
  <title>text-overflow</title>
  <style>
  body{
    width: auto;
  }
  #items{
  overflow-x: scroll;
  width: auto;
  }
  .item{
     display: inline-block;
     width: 400px;
     height: 100px;
     border:1px solid;
  }
  </style>
 </head>
 <body>

        <div id="items">
           <div class="item">
             Item content
           </div>
           <div class="item">
             Item content
           </div>
           <div class="item">
             Item content
           </div>
           <div class="item">
             Item content
           </div>
           <div class="item">
             Item content
           </div>
           <div class="item">
             Item content
           </div>
        </div>

 </body>
</html>
Run Code Online (Sandbox Code Playgroud)

html css scroll horizontal-scrolling

7
推荐指数
1
解决办法
3万
查看次数

标签 统计

css ×1

horizontal-scrolling ×1

html ×1

scroll ×1