I'm learning flex box
and can not get my text to center align.
I am aware I can center align vertically using padding
, but I want it to be more of an automatic centering and not edit each item every time.
Although this link did help, it was not what I was looking for.
I need to get my .item
to center horizontally and vertically with the minimum amount of code.
.parent {
display: flex;
flex-direction: row-reverse;
justify-content: space-around;
flex-wrap: wrap;
}
.item {
color: white;
margin: 0px;
width: auto;
height: 200px;
background-color: blue
}
<div class="example">
<h2> Display: flex </h2>
<div class="example-content">
<div class="parent">
<div class="item">If you wanna</div>
<div class="item">Then you gotta</div>
<div class="item">Go findz it</div>
</div>
</div>
</div>