【发布时间】:2016-08-16 05:56:26
【问题描述】:
我有一个 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>
【问题讨论】:
标签: css responsive-design scrollbar overflow horizontal-scrolling