css - 重新调整浏览器宽度大小时水平滚动条不起作用?

标签 css responsive-design scrollbar overflow horizontal-scrolling

我有一个 div,里面有带图像的 div。我想要的是显示所有图像,但是当浏览器宽度重新调整大小(更小)时,出现自动水平滚动条而不是图像堆积在下面。我正在尝试创建它,但它不起作用。有帮助吗??

<div style="height:80px;width:auto;border:1px solid red;white-space:nowrap;overflow-y:hidden;-ms-overflow-y:hidden;overflow-x:scroll;-ms-overflow-x:scroll;">
  <div style="height:60px;width:90px;display:inline-block;">
    <a href="#" >
      <img style="max-height:60px;height:auto;max-width:90px;width:auto;margin:0 auto;padding:5px;display:inline-block;vertical-align:middle;" src="img1.png"  />
    </a>
  </div>
  <div style="height:60px;width:90px;display:inline-block;">
    <a href="#" >
      <img style="max-height:60px;height:auto;max-width:90px;width:auto;margin:0 auto;padding:5px;display:inline-block;vertical-align:middle;" src="img1.png"  />
    </a>
  </div>
  <div style="height:60px;width:90px;display:inline-block;">
    <a href="#" >
      <img style="max-height:60px;height:auto;max-width:90px;width:auto;margin:0 auto;padding:5px;display:inline-block;vertical-align:middle;" src="img1.png"  />
    </a>
  </div>
  <div style="height:60px;width:90px;display:inline-block;">
    <a href="#" >
      <img style="max-height:60px;height:auto;max-width:90px;width:auto;margin:0 auto;padding:5px;display:inline-block;vertical-align:middle;" src="img1.png"  />
    </a>
  </div>
  <div style="height:60px;width:90px;display:inline-block;">
    <a href="#" >
      <img style="max-height:60px;height:auto;max-width:90px;width:auto;margin:0 auto;padding:5px;display:inline-block;vertical-align:middle;" src="img1.png"  />
    </a>
  </div>
</div>

最佳答案

您的代码似乎符合我的预期。 https://fiddle.jshell.net/ph110293/goetup62/

关于css - 重新调整浏览器宽度大小时水平滚动条不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36796584/

相关文章:

html - Bootstrap - 构建流体网格

html - 滚动在 Firefox 中的 <a> block 内不起作用

python - 如何将滚动条附加到 tkinter 框架中的列表框?

html - 如何使绝对定位的 HTML block 元素居中? (相对于其 parent ?)

css - 是否可以找到导致规则在 Chrome 检查器中变灰的父 CSS?

jquery - 如何修改 Magnific Popup 中的关闭按钮行为?

css - 顶部栏菜单在移动 View 中不可见

html - BootStrap 移动导航格式问题

html - 如何防止 IE10 中的滚动条覆盖内容?

html - 动画 Angular js 按钮