Bump Up hover effect on Div with css and html only -
i trying have hover effect on div div containing image moves on hover. want "polaroid" div move on hover. effect works if apply hover class img not whole div. please help. fiddle here
markup:
<div id="home-gal-col"> <span class="span-homegal"> <a href="/listings/category/accessories/"> <div class="polaroid"> <img src="/images/homegal/picture.jpg"> <p>picture</p> </img> </div> </a> </span> </div> css:
#home-gal-col { width:15%; float:left; padding:5px; } .polaroid { border: 10px solid #fff; border-bottom: 15px solid #fff; -webkit-box-shadow: 3px 3px 3px #777; -moz-box-shadow: 3px 3px 3px #777; box-shadow: 3px 3px 3px #777; } .polaroid img { margin: 0 auto; width: 100%; } .polaroid p { text-align: center; color: #d51386; } .span-homegal { -webkit-transition: margin 0.2s ease-out; -moz-transition: margin 0.2s ease-out; -o-transition: margin 0.2s ease-out; } .span-homegal a:hover { margin-bottom: 5px; }
is looking for?
.polaroid:hover{ margin-top: -10px; } you can add css 3 animation adding transition properties on .polaoid class:
.polaroid { border: 10px solid #fff; border-bottom: 15px solid #fff; -webkit-box-shadow: 3px 3px 3px #777; -moz-box-shadow: 3px 3px 3px #777; box-shadow: 3px 3px 3px #777; -webkit-transition: margin 0.2s ease-out; -moz-transition: margin 0.2s ease-out; -o-transition: margin 0.2s ease-out; transition: margin 0.2s ease-out; } living example: http://jsfiddle.net/txgvh/2/
Comments
Post a Comment