CSS horizontal scroll

前端 未结 4 1708
遇见更好的自我
遇见更好的自我 2020-11-29 03:30

I\'m trying to create a

with a series of photos which are horizontally scrollable only.

It should look something like this LINK;

H

4条回答
  •  天命终不由人
    2020-11-29 04:05

    You can use display:inline-block with white-space:nowrap. Write like this:

    .scrolls {
        overflow-x: scroll;
        overflow-y: hidden;
        height: 80px;
        white-space:nowrap
    }
    .imageDiv img {
        box-shadow: 1px 1px 10px #999;
        margin: 2px;
        max-height: 50px;
        cursor: pointer;
        display:inline-block;
        *display:inline;/* For IE7*/
        *zoom:1;/* For IE7*/
        vertical-align:top;
     }
    

    Check this http://jsfiddle.net/YbrX3/

提交回复
热议问题