I know you can do it with a single line by setting the line-height, but my data might take up more than one line. I tried doing something with setting display:table for parent and display:table-cell for the child, but I couldn't get it to work.
Here is my jsfiddle
Well, I played around with the jsFiddle for a bit, and this is what I came up with:
http://jsfiddle.net/rVgkJ/7/
The relevant CSS:
.small_wrapper_div{
width:100%;
display:table;
}
.small_wrapper_div > div{
display:table-cell;
vertical-align: middle;
}
.small_picture_div{
width:50px;
height:50px;
}
.small_picture_div img {
width:50px;
display:block;
}
.small_text_div{
padding-left:10px;
}
In a nutshell you will need to add position: relative to the containing div (small_wrapper_div) and then you can add:
.small_text_div a {
display: table-cell;
vertical-align: middle;
text-align: left;
}
and change .small_text_div to be some combination of:
.small_text_div {
height:100%;
padding-left:10px;
width:250px;
position: absolute;
left:50px;
top: 2px;
display: table;
}
And you will have the text vertically centered.
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