In my example, the first inline-block (with text) drops out of the line. The vertical-align: top parameter corrects the situation, but why is it happening there? It is not clear how adding text inside the block broke the construction
<style> .in1 { width: 120px; height: 120px; background-color: green; display: inline-block; margin-right: 10px; margin-bottom: 10px; background-size: cover; } .span { font-size: 12px; color: white; font-family: Tahoma; } </style> <div class="container1"> <div class="in1"><span class="span">Some text</span></div> <div class="in1"></div> <div class="in1"></div> <div class="in1"></div> <div class="in1"></div> </div>