Showing posts with label CSS. Show all posts
Showing posts with label CSS. Show all posts

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/

Oct 11, 2013

CSS(a/img) - Remove extra space on anchor with image tag

Just want to share the work around.

Normally around will goes like this.
<a href="#"><img  src="/image.jpg" /></a>

Update code to remove the extra space. Just add the display:block in the image tag.
<a href="#"><img style="display:block" src="/image.jpg" /></a>

Jul 29, 2013

CSS - Understanding the unit for font size.

Normally the equivalent of the unit is listed below.
1em = 12pt = 16px = 100%.

However that the unit have same conversion value. There still a different behavior on the display of the content.

As explained in kyleschaeffer.com, using a percent(%) much more reliable to use. And he was also recommend to use % as unit to use in website designning. See more explanation in his topic here @kyleschaeffer.com