开发者

CSS for carousel of elements (container has fixed width, scrollable area has infinite width)

What CSS is required to make it so a viewport can have an infinitely wide list inside of it?

开发者_Python百科<div class='viewport'>
  <ul class='scrollable-content'>
    <li></li>
    <li></li>
    ...
  </ul>
</div>

This doesn't seem like it should require javascript. It's gotta be something simple, just can't wrap my mind around it at the moment.


Something like this? http://jsfiddle.net/vJgtM/


This might work also (http://jsfiddle.net/vJgtM/7/):

CSS:

div.viewport {
    width: 500px;
    overflow: auto;
}

div.viewport ul {
    width: 100%;
     white-space: nowrap;
}

div.viewport ul li {
    display: inline;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜