我有一个 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/