Is there a way to align a button to the left inside a div that has the class justify-content-center
applied? Here is the code I tried:
<div class="card-header justify-content-center">
<div>
<div class="ml-5">
Text in Center
</div>
<div class="float-right"><button>Button on right</button></div>
</div>
</div>
Unfortunately, using float-right
did not work due to the presence of justify-content-center
. I attempted placing justify-content-center
on a separate div, but the text still did not center properly.
Here is the modified code snippet:
<div class="card-header">
<div class="justify-content-center">
<div class="ml-5">
Text in Center
</div>
<div class="justify-content-end"><button>Button on right</button></div>
</div>
</div>
Despite this adjustment, the alignment issue persists. It seems applying the justify-content-center
class on another div is not resolving the problem of centering the text as expected.