A small example:
<div class="c">
<div class="item">
<div class="wrap">
<div class="wrap-item"></div>
<div class="wrap-item"></div>
<div class="wrap-item"></div>
</div>
</div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
.item {
width: 100px;
height: 100px;
background-color: black;
display: inline-block;
}
.wrap {
width: 100px;
height: 50px;
background: green;
}
.wrap-item {
width: 30px;
height: 30px;
background: gray;
display: inline-block;
}
codepen. Please explain why the first element is shifted downwards. I noticed that this is affected by the height of the element, but I can't figure out why this happens. Is this standard behavior or am I doing something wrong? If this is standard behavior, how do I correct it?