Within my container div, I have two spans. An issue arises when I attempt to align the items to the center using align-items: center
, as this causes the spans to lose their defined height and border-radius properties. My goal is to keep the heights and border radius intact while simply centering them. Is there a way to achieve this?
CSS for the parent div:
const Container = styled.div`
display: inline-flex;
overflow: hidden;
border-radius: 4px;
margin: 0px 8px 10px 8px;
height: 70px;
`;
CSS for the child span:
const TextContainer = styled.span`
padding: 8px 11px;
`;
Before applying align-items: center
:
https://i.sstatic.net/HTyQW.png
After applying align-items: center
: https://i.sstatic.net/4J5nF.png