Aligning to the bottom in flexbox
Solution 1:
You need to make the parent a flex container:
.flex-list .flex-row .flex-item-wrapper .flex-item {
width: 100%;
height: 100%;
display: flex; /* new */
flex-direction: column; /* new */
}
Then, tell the .caption
element to fill available height:
.caption { flex: 1; }
Revised Fiddle
It's a common question. Here are other options:
- Methods for Aligning Flex Items
- Flexbox align to bottom
- Pin a flex item to the bottom of the container
- Pin element (flex item) to bottom of container
- Pin element to the bottom of the container
- Pin a button to the bottom corner of a container
- Aligning element to bottom with flexbox
- Aligning items to the bottom using flex
- Align content of flex items to bottom
- Align content in a flex container to the bottom
- Aligning element to bottom with flexbox
- Nested flexbox, align-items do not flex-end
- align-content: flex-end not shifting elements to container bottom
- Sticky footer with flexbox
- Why isn't align-self aligning my div to the bottom of my flexbox?
- How to bottom-align an element inside a flex item?
- Flexbox difficulties aligning icons to bottom of container
- Make an item stick to the bottom using flex in react-native
- Equal height columns and align last item to bottom
Solution 2:
If you change your .caption
code to:
.caption {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
}
and then add:
.flex-item {
display: flex;
flex-direction: column;
}