我有一些应用程序截图,我想添加到我的网站,但我想,但他们在一个水平滚动区域,就像iTunes商店应用程序截图区域。
我如何实现这一点,或者有人能给我指明正确的方向。谢谢。
发布于 2011-11-24 17:00:27
使用CSS创建一个DIV:
.overflowdiv {
height: 310px;
overflow-x: auto;
overflow-y: hidden;
width: 980px;
}
这将创建一个带有自动溢出的980x310px div,因此如果内容比像素量更宽,它将自动添加滚动。
为了防止“新行”的发生,我通常会在其中添加一个表:
<div class="overflowdiv">
<table>
<tr>
<td>
Content here
</td>
<td>
Content here
</td>
<td>
Content here
</td>
<td>
Content here
</td>
</tr>
</table>
发布于 2011-11-24 16:59:05
<div style="width: 800px; height: 100px; overflow: auto">
<div style="height: 100px">
... lots of content here ...
</div>
</div>
只要你设置"content“的样式,让它水平流动,一旦内部div变宽超过800px并”溢出“外部div,它就会创建一个水平滚动条。
发布于 2011-11-24 17:00:28
我最近创建了一个很好的无限图库,你可以在这里看到它的实际效果:
因为这里有很多CSS,HTML,JS要粘贴...就是“view surce”。如果你有问题,我很乐意为你效劳。
https://stackoverflow.com/questions/8260369
复制相似问题