CSS Positioning element relative to grandparent

css

I'm trying to position an element (a button) relative to the element 2 elements before it (a picture). There is a varying amount of text between the picture and the button. Take a look at my site:

http://gorilla-gym.com/product-category/fitness-attachments/

What I'm trying to achieve is having the "Shop Now" buttons align horizontally for each product listing regardless of how much text is underneath the picture.

It seemed to me the most logical way to do this way to position the button relative to the picture, but I can't figure out how to do this. Let me know if you guys have an idea of how to do this, or if there's a better way to achieve what I want to do.

Thanks in advance.

Best Answer

check this one i think you want something like this

http://jsfiddle.net/FWzzR/1/

css

ul.products { 
    display:table; 
    width:100%; 
    table-layout:fixed; 
    border-collapse:separate; 
    border-spacing:10px; 
}

.products > li { 
    background-color: #4F81BD; 
    border:2px solid #385D8A; 
    position: relative; 
    width: 22.05%; 
    display: table-cell; 
    padding:10px; 
    padding-bottom:50px; 
    text-align:center; 
    vertical-align:top; 
}

.products > li >a { 
    display:block; 
}

.products a.button { 
    position:absolute; 
    bottom:10px; 
    left:50%; 
    margin-left:-40px; 
    font-size: 100%; 
    line-height: 1em; 
    cursor: pointer; 
    text-decoration: none; 
    padding: 6px 10px; 
    font-family: inherit; 
    font-weight: bold; 
    color: #FFF; 
    text-shadow: 0 1px 0 #FF6311; 
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.8); 
    border: 1px solid #973100; 
    -webkit-border-radius: 2px; 
    -moz-border-radius: 2px; 
    border-radius: 2px; 
    background: #FD5200; 
    background: -webkit-gradient(linear, left top, left bottom, from(#FD5200), to(#CA4100)); 
    background: -webkit-linear-gradient(#FD5200, #CA4100); 
    background: -moz-linear-gradient(center top, #FD5200 0%, #CA4100 100%); 
    background: -moz-gradient(center top, #FD5200 0%, #CA4100 100%); 
    -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.075), inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1); 
    -moz-box-shadow: inset 0 -1px 0 rgba(0,0,0,0.075), inset 0 1px 0 rgba(255,255,255,0.3), 0 1px 2px rgba(0,0,0,0.1); 
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.075), inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1); 
}