How is it possible to get the .child
s to all have the same height. height: 100%
is not working an neither is flex-grow: 1
. What is the rec
.parent {
display: flex;
flex-direction: row;
width: 800px;
justify-content: center;
align-items: stretch;
}
.child {
width: 150px;
background-color: green;
border: solid 1px black;
}
<div class="parent">
<div class="child">
Short Text
</div>
<div class="child">
Long Text: Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla
</div>
<div class="child">
Short Text
</div>
</div>
Remove the align-items:center
from the parent and add flex properties to the children for their content alignment.
.parent {
display: flex;
flex-direction: row;
justify-content: center;
width: 800px;
}
.child {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
width: 150px;
background-color: green;
border: solid 1px black;
}
<div class="parent">
<div class="child">
Short Text
</div>
<div class="child">
Long Text: Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla
</div>
<div class="child">
Short Text
</div>
</div>