Using CSS, how can I style the following:
- Mercury
- Mercury (0.4 AU from the Sun) is the closest planet to th
I need to do this and have the content vertically centered, relative to the content. I used display: inline-block, together with vertical-align: middle
See full example on Codepen here
.dl-horizontal {
font-size: 0;
text-align: center;
dt, dd {
font-size: 16px;
display: inline-block;
vertical-align: middle;
width: calc(50% - 10px);
}
dt {
text-align: right;
padding-right: 10px;
}
dd {
font-size: 18px;
text-align: left;
padding-left: 10px;
}
}