I am trying to have a container with many child tiles of content inside. Each child tile contains data that I want centered so that is why flex
is on the child -- so that I can align the tile content.
I want to align 3 to a line evenly so I put flex
on the parent class and wanted to space-evenly
but that doesn't seem to work. Any ideas on what I am doing wrong?
<div class="container">
<div class="child">
<img src="">
<span>TITLE</span>
</div>
<div class="child">
<img src="">
<span>TITLE</span>
</div>
<div class="child">
<img src="">
<span>TITLE</span>
</div>
<div class="child">
<img src="">
<span>TITLE</span>
</div>
<div class="child">
<img src="">
<span>TITLE</span>
</div>
<div class="child">
<img src="">
<span>TITLE</span>
</div>
<div class="child">
<img src="">
<span>TITLE</span>
</div>
</div>
CSS
.parent {
display: flex;
max-width: 1200px;
}
.child {
display: inline-flex;
margin-bottom: 26px;
flex-direction: column;
justify-content: center;
align-items: center;
width: 396px;
height:396px;
}