Possible Duplicate:
How to make an image center (vertically & horizontally) inside a bigger div
HTML code:
<div class="promo_tumbs col_12">
<div class="promo_tumb"></div>
<div class="promo_tumb"></div>
<div class="promo_tumb"></div>
<div class="promo_tumb"></div>
<div class="promo_tumb"></div>
</div>
CSS part:
.promo_tumbs {
height: 155px;
background: #058;
}
.promo_tumb {
height: 75px;
width: 125px;
background: #990000;
float: left;
margin: 0 10px;
text-align: center;
}
How can I vertically center .promo_tumb
?
Read this article on vertical centering.
http://www.jakpsatweb.cz/css/css-vertical-center-solution.html
If you dont wanna support IE7 or lesser then you can use vertical-align : middle
.
Otherwise:
display
to table
in .promo_tumbs col_12
vertical-align
to middle
& display
to table-cell
for
.promo_tumb
and it should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With