Адаптивная верстка каталога. Как установить кнопку внутри блока внизу по центру?
const OurMenu = () => {
return (
<div className='menu'>
<h1 className="menuTitle">Our Menu</h1>
<div className="menuList">
{MenuList.map((item, key) => {
return <div className="menuItem">
<div>
<img src={item.image} alt="smth wrong!" />
<h4>{item.name}</h4>
<p>{item.price} $</p>
<p className='promo'>{item.promo_price}$</p>
<h4>{item.description}</h4>
<button className='addToOrder'>Add to Order</button>
</div>
</div>
})}
</div>
</div>
)
}
// Css файл:
.menu {
width: 100%;
height: 150vh;
text-align: center;
background: #D2691E;
padding: 20px;
}
.menuTitle {
font-size: 35px;
}
.menuList {
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
margin-top: 10px;
}
.menuItem {
width: 400px;
background-color: aliceblue;
opacity: 0.9;
margin: 10px;
align-items: center;
justify-content: center;
flex-direction: column;
border-radius: 10px;
cursor: pointer;
transition: .3s;
}
.menuItem:hover {
transform: scale(1.05);
opacity: .9;
}
.menuItem img {
width: 100%;
height: 250px;
}
.menuItem h4 {
font-size: 20px;
margin-top: 10px;
letter-spacing: 2px;
}
.menuItem p {
font-size: 20px;
margin-top: 10px;
letter-spacing: 2px;
text-decoration: line-through;
}
.menuItem .promo {
font-size: 28px;
margin-top: 10px;
letter-spacing: 2px;
color: red;
text-decoration: none;
}
.menuItem .addToOrder {
left: 0;
top: 10px;
position: relative;
background-color: black;
color: #D2691E;
font-weight: 800;
text-align: center;
}
Как в этой ситуации сверстать чтобы у всех карточек menuItem кнопка находилась строго внизу по центру и не меняла местоположение на разных размерах экрана?
Источник: Stack Overflow на русском