I'm creating a "Why Choose Us" splash page and I want to create tables with an image on one side and a reason on the other. I need the image to vertically align in the center.
So far I've tried making another table inside the table, and vertically aligning the image with 'vertical-align: middle' via a table cell wrapped around it.
<section class="reason">
<div class="content">
<div class="float-left table">
<div class="table-cell">
<img class="thumbnail" src="https://1eican1u2cuw7g1kw7btt2xy-wpengine.netdna-ssl.com/wp-content/uploads/personal-attention-vamospanish-85x85.png">
</div>
</div>
<div class="float-right">
<h3>
Lorem Ipsum Dolor Sit Amet
</h3>
<p class="appeal">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
</div>
</section>
<style>
.reason {
padding: 100px;
background-color: #fff;
}
.content {
display: table;
clear: both;
max-width: 935px;
margin: 0 auto;
}
.float-left {
float: left;
width: 50%;
}
.float-right {
float: right;
width: 50%;
}
.table {
display: table;
}
.table-cell {
display: table-cell;
vertical-align: middle;
}
.thumbnail {
display: block;
margin: 0 auto;
}
</style>
Here's a codepen outlining the problem: https://codepen.io/AlecAcres/pen/NVMRoY