How to align a button always down?

Asked

Viewed 2,671 times

1

2 answers

2

You can do using the flexbox, only if necessary to include the information (card-title and ul) in one another div. I created and named .card-info. To the card-body added the classes d-flex align-content-between flex-wrap.

Example in Jsfiddle: https://jsfiddle.net/5s2w2mkL/

Bootstrap Flex documentation (where you can find several other grid/alignment utilities): https://getbootstrap.com/docs/4.0/utilities/flex/

1


I don’t think Bootstrap has its own classes, so you can change the classes in your CSS to always adjust the element in the bottom.

For that I created a class .embaixo to the button and adjusted the class .card as below:

.embaixo{
   position: absolute;
   left: 5%;
   bottom: 20px;
   width: 90%;
}

.card{
   padding-bottom: 40px;
}

The absolute positioning is so that the button is always on bottom, and the padding in the .card is to compensate for the difference because the absolute positioning does not influence the fluidity and can be above the text.

See on Jsfiddle.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.