I'm facing an issue with centering my content vertically. Upon inspecting the divs, I noticed some empty space below them that seems to be causing the problem. When I tried adding <line-height: 3>
in the dev tool styles, it seemed to center properly. However, I prefer not to hardcode solutions like this and usually rely on flex properties, but I can't seem to figure out what's wrong this time.
If you require any additional information, please feel free to ask!
.table-page-nav-wrapper {
display: flex;
justify-content: center;
align-items: center;
}
.arrow-btn {
text-align: center;
width: 50px;
height: 50px;
border-radius: 4px;
box-shadow: 0 5px 5px rgba(0,0,0,0.2);
}
.page-index-inner {
text-align: center;
width: 244px;
height: 50px;
border-radius: 4px;
box-shadow: 0 5px 5px rgba(0,0,0,0.2);
margin: 0px 20px;
}
<div class="table-page-nav-wrapper">
<div class="arrow-btn"><</div>
<div class="page-index-inner">Why am I not centering correctly?</div>
<div class="arrow-btn">></div>
</div>