I attempted to center an inline-block vertically in the following manner:
div {
width: 50px;
height: 50px;
background: red;
line-height: 50px;
}
span {
display: inline-block;
width: 20px;
height: 20px;
background: white;
}
<div>
<span></span>
</div>
However, I noticed that the span is not properly centered vertically. Can anyone explain why this is happening?