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.
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.
Subscribe to our weekly Newsletter & Keep getting latest article/questions in your inbox weekly