Design comparison
Solution retrospective
Please help me with the alignment of these 3 buttons
Community feedback
- @mickygingerPosted over 3 years ago
Hi Deep!
Yeah the buttons on this design can be a little tricky. There's a couple of approaches.
- Old skool
- Set the
.col-md-3
toposition: relative;
- Set the
button
toposition: absolute; bottom: 0; left: 0;
This will fix the button to the bottom left corner of the containing element. The problem though is that the button will "float" on top of any text that fills up the container, so it doesn't work well for all designs.
- Flexbox
- Set the
.col-md-3
todisplay: flex; flex-direction: column; align-items: space-between;
This will ensure that the text and the button sit one on top of the other and any extra space in the container will sit between the two elements. That should force the button to the very bottom of the container and the text should stay on the top.
For more flexbox fun, check out https://flexboxfroggy.com/
2 - Account deleted
if you're using bootstrap add those classes to your main card div:
d-flex flex-column justify-content-between
d-flex => display:flex; flex-column => flex-direction: column; justify-content-between: justify-content:space-between; And check out docs0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord