The issue arises when applying margin to any element within the product or slider div, causing all list items to shift downwards.
.product-slider {
margin-top: 16px;
text-align: center;
}
.slide-item {
list-style-type: none;
display: inline;
width: 80%;
overflow: hidden;
margin: auto;
}
.product, .slider {
height: 200px;
border: 1px solid black;
display: inline-block;
}
.product {
width: 25%;
}
.slider {
width: 5%;
}
<ul class="product-slider">
<li class="slide-item"><div class="slider"><i class="fas fa-angle-left"></i></div></li>
<li class="slide-item"><div class="product">Test</div></li>
<li class="slide-item"><div class="product">Test</div></li>
<li class="slide-item"><div class="product">Test</div></li>
<li class="slide-item"><div class="slider"><i class="fas fa-angle-right"></i></div></li>
</ul>