I am developing an app in ReactJS and i'm using the following: MaterialUI (for react) and React Flexbox.
The problem i'm having is trying to position the card buttons on bottom (the problem that seems to have spammed the internet in different frameworks). I am using the card from here -> https://material-ui.com/demos/cards/
I've tried pretty much everything i could think of from align-items to align-self and different display types. I might be missing something here since i usually work with Bootstrap so i hope a CSS Master can help me out. I'll attach the pic below for ref.
Also for ref here's how my code looks in react( ApiPosts is my cards component) ->
<Grid container>
<Grid item xs={12}>
<Paper className={classes.paper}>
<Row className="rowSpacer">
<Col xs>
<Typography variant="title" align="center" color="textPrimary" gutterBottom>
Posts are below
</Typography>
</Col>
</Row>
<Divider />
<ApiPosts />
</Paper>
</Grid>
</Grid>
And finally my cards are wrapped in <Row around="xs">
(4 posts in a row) and each card in a col <Col xs >
Thanks in advance!
Edit: Solved thanks to Ivan's answer.Here's the code in case anyway needs it (working on Material-UI Cards).
.portCardCl {
display: flex;
flex-direction: column;
height:100%;
}
.portBodyCl {
display: flex;
flex: 1 0 auto;
align-items: flex-end;
justify-content: center;
flex-direction: column;
}
.portButCl{
display: flex;
justify-content: flex-start;
}
portCardCl
goes on the first <Card>
, portBodyCl
goes on <CardActionArea>
and finally portButCl
goes on <CardActions>
Here is example with css-grid.
Here is example of card with
flex
using only