How can I center two divs next to each other, as described here? The issue is that my right div always ends up slightly lower than the left one when I add a <span>
and a heading. Why does this happen and what can I do to prevent it?
#right {
display: inline-block;
width: 100px;
height: 160px;
padding: 15px;
background: rgba(0, 0, 0, .4);
border-radius: 1px;
box-shadow: 0 1px 1px rgba(0, 0, 0, .4) inset, 0 1px 0 rgba(255, 255, 255, .2);
}
#wrapper {
text-align: center;
padding: 40px;
height: 160px;
max-height: 160px;
}
#left {
display: inline-block;
width: 100px;
height: 160px;
padding: 15px;
background: rgba(0, 0, 0, .4);
border-radius: 1px;
box-shadow: 0 1px 1px rgba(0, 0, 0, .4) inset, 0 1px 0 rgba(255, 255, 255, .2);
}
<div align="center" id="wrapper">
<div id="left"></div>
<div id="right">
<span style="text-decoration: underline;">Heading</span>
<div id="some-content"></div>
</div>
</div>