I'm trying to make an array of "buttons" with links. It works fine when the text is only one line, but if the text wraps to two lines, the lines get left justified. I'd rather have both lines centered.
.brand-wrap {
display: flex;
flex-direction: row;
flex-wrap: wrap;
width: 500px;
height: 100%;
font-family: Montserrat, verdana, sans-serif;
}
.brand {
font-size: 14px;
width: 31%;
height: 50px;
background-color: #eee;
border: solid 3px white;
display: flex;
justify-content: center;
align-items: center;
}
.brand A {
text-decoration: none;
color: #6f6f6f;
line-height: normal;
}
a {
outline: none;
border: none;
}
<div class="brand-wrap">
<div class="brand"><a href="#">Short</a></div>
<div class="brand"><a href="#">words</a></div>
<div class="brand"><a href="#">gets centered</a></div>
<div class="brand"><a href="#">Both horizontally</a></div>
<div class="brand"><a href="#">and vertically</a></div>
<div class="brand"><a href="#">But long sentences get left-justified</a></div>
</div>