I have a simple list of divs, with the exception that one div is an inline-block
<div>xxxxxxxxxxxxxxxxxxxx</div>
<div>xxxxxxxxxxxxxxxxxxxx</div>
<div>xxxxxxxxxxxxxxxxxxxx</div>
<div>xxxxxxxxxxxxxxxxxxxx</div>
...
div {
background-color: #000;
color: #fff;
line-height: 20px;
font-size: 20px;
}
div:nth-child(5) {
display: inline-block;
color: #bada55;
}
all looks just fine (font-size :20px). However, when I change the font-size to 10px things are getting weird
Although I can fix it by adding
body { font-size: 0 }
I still don't understand why it did work with a line-height and font-size of 20px ? Any suggestions ?