Apr 11, 2014

CSS scrolling at horizontal behavior

Your HTML data.

<div class="wrapper">
  <div class="scrolls">
       <img src="http://placehold.it/50x50" />
       <img src="http://placehold.it/50x50" />
       <img src="http://placehold.it/50x50" />
  </div>
</div>

CSS Data
.wrapper { 
        background:#EE0000; 
        box-shadow: 1px 1px 10px #999; 
        margin: auto; 
        text-align: center; 
        position: relative;
        -webkit-border-radius: 5px;
        -moz-border-radius: 5px;
        border-radius: 5px;
        margin-bottom: 20px !important;
        width: 800px;
        padding-top: 5px;
    }
    .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;
    *zoom:1;
    vertical-align:top;
    }

See Reference output here http://jsfiddle.net/YbrX3/

No comments: