I have 3 divs that contain text. The text has different lengths, meaning that if I put these three divs into another div, if I justify-content: center
this div, the middle one out of the three divs won't be in the center of the page.
What I want to achieve is to have the middle div in the center of the webpage and the first div to be to left of it and the third one to the right, with no space between (except padding).
Edit: I don't know if I maybe was unclear about what I am asking: I want to center .container-footer-3
but .footer-company
("Center") should be in the center of the page, not in the center of the div.
-> In other words, how do I center the parent div, containing all these 3 divs but not the center of the div to the center page, instead "Center" div to the center of the page?
.container-footer-3 .nav {
display: inline-table;
padding: 0 20px 0 20px;
}
.footer-nav {
display: flex;
justify-content: center;
}
.footer-company{
position: absolute;
left: 50%;
margin-left: -50px;
width: 100px;
height: 100px}
<div class="footer-nav">
<div class="container-footer-3">
<div class="footer-explore nav">
<h20>Left</h20>
<ul>
</ul>
</div>
<div class="footer-company nav">
<h20>Center</h20>
<ul>
</ul>
</div>
<div class="footer-socials nav">
<h20>RightRightRightRight</h20>
<ul>
</ul>
</div>
</div>
</div>