溢出-x不起作用

Sie*_*yuu 1 html css scroll

这是我的代码

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <title></title>
  <style type="text/css">
    .bigbox {
      width:1024px;
      height:600px;
      background-color:#000000;
      overflow-x:auto;
      overflow-y:hidden;
    }
    .box{
      width:500px;
      height:500px;
      float:left;
      background-color:#AAAAAA;
      margin:5px;
    }
  </style>
  </head>
  <body>
    <div class="bigbox">
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
    </div>
  </body>
</html>
Run Code Online (Sandbox Code Playgroud)

如何使所有框水平显示?

而bigbox有scroll bar与width固定。

我试图将宽度更改为5000px,它可以工作,但是宽度在盒子上

Roh*_*zad 5

演示 -的jsfiddle演示

HI现在添加一些属性

像这样

    .bigbox {
    white-space:nowrap;
    }
    .box{
    float:left;  // remove this line 
    display:inline-block;
    vertical-align:top;
    }
Run Code Online (Sandbox Code Playgroud)

现场演示