in the example below how to place GO Y CENTER
on center vertically
i.e. why align items:center
doesn't work
also, can I do the same staying with grid
- without using flex
?
.apanel{
display: grid;
grid-template-columns: repeat(auto-fit, minmax(120px, 140px));
justify-content: center;
grid-column-gap:15px;
grid-row-gap:25px;
width:calc(100% - 30px);
margin:0 auto;
text-align:center;
}
.apanel .card{
display:flex;
flex-direction:column;
background:#eee;
}
.apanel .title{
line-height:1.5em;
padding:9px 14px;
background:gold;
flex:1;
align-items:center;
}
<div class='apanel'>
<a class='card' href='#'>
<div class='sub'>LOREM</div>
<div>1-2-3</div>
<div class='title'>GO Y CENTER</div>
</a>
<a class='card' href='#'>
<div class='sub'>LOREM</div>
<div>1-2-3</div>
<div class='title'>LOREM IPSUM DOLOR SIT AMET CONSECTETUR</div>
</a>
</div>