The code with table-cell
can do the trick but you need to remove the float
property:
div.flickr_badge_image {
width:23.8%;
margin: 0 1.5% 1.5% 0;
/*float:left; Remove this*/
}
Check this Demo Fiddle
Now if you want to keep the float
you can also do this to center the a
tags inside:
div.flickr_badge_image:before {
content:" ";
display:inline-block;
height:100%;
background:red;
vertical-align:middle;
}
div.flickr_badge_image a {
display:inline-block;
vertical-align:middle;
}
Check Demo Fiddle2