How to right-align button inside Flex div?

How can I right align a button which is index div using CSS flex?

I cannot use float:right or posoition:absolute/relative, so please let me know how can I do this using Flex in CSS.

Asked by:- Vinnu
: 1276 At:- 6/3/2019 3:36:49 PM
CSS right-align-using-flex css-flex

1 Answers
profileImage Answered by:- pika

To align-right using Bootstrap 4 Flex CSS properties to a div

display:flex;  align-items: flex-end; flex-direction:column

So, your complete HTML to align button

 <div style="display:flex;  align-items: flex-end;flex-direction:column">
         <a href="/Url" class="btn btn-primary">Proceed to Checkout</a>

Here is the fiddle

That's it.

At:- 6/6/2019 7:53:43 AM

Login/Register to answer
Register directly by posting answer/details

Full Name *

Email *

By posting your answer you agree on privacy policy & terms of use