Bump Up hover effect on Div with css and html only

Problem

I am trying to have a hover effect on a div so that the div containing the image moves up on hover. I want the "polaroid" div to move up on hover. This effect works if i just apply the hover class to the img but not the 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 a {
-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;
}
Problem courtesy of: user2725936

Solution

Is this what you are looking for?

.polaroid:hover{
    margin-top: -10px;    
}

You can also add the CSS 3 animation adding the transition properties on the .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/

Solution courtesy of: Alvaro

Discussion

There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.