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
0
: 501 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>
 </div>

Here is the fiddle https://jsfiddle.net/4wy3v15z/

That's it.

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






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

Full Name *

Email *




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

Subscribe Now

Subscribe to our weekly Newsletter & Keep getting latest article/questions in your inbox weekly