I've come across this strange problem whereby the font-size
in one div
somehow effects the positioning of the next div
. My code is:
<div class="first">
1
</div>
<div class="second">
2
</div>
And CSS:
.first{
border: 1px blue solid;
display: inline-block;
font-size: 47px;
height: 80px;
width: 105px;
}
.second{
border: 1px red solid;
height: 80px;
width: 105px;
display: inline-block;
}
The result is:
The second div
is not horizontally aligned with the first div
.
The jsfiddle here. If I remove the font-size, they both align horizontally. Why is this happening?