내부 div가 외부 div의 맨 아래에 고정되기를 원하기 때문에 상대 위치가있는 외부 div가 있고 내부에 절대 위치가있는 내부 div가 있습니다 (하단 : 0).
이제 내부 div 안에 button을 가운데 정렬하는 방법은 무엇입니까?
JSX :
<Card>
<CardTitle>{voucher.voucherTitle}</CardTitle>
<CardContent>{voucher.voucherDesc}</CardContent>
<CardFooter>
<RedeemBtn>{`Redeem`}</RedeemBtn>
</CardFooter>
</Card>
스타일 component :
const Card = styled.div`
width: 312px;
max-width: 100%;
height: 200px;
box-sizing: border-box;
justify-content: center;
background-image: linear-gradient(#fff calc(100% - 50px),hsla(0,0%,93.3%,.4));
`
const CardFooter = styled.div`
position: absolute;
bottom: 0;
color: #e40000;
width: 100%;
align-content: center;
`
const RedeemBtn = styled.button`
margin: 0 auto;
`