Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show a text content as left aligned in Bootstrap 5 Modal footer

Tags:

bootstrap-5

I have a Bootstrap Modal. In the footer, a text content that should be aligned in left and a close button that should be aligned in right.

But by default, both are aligned in right.

<div class="modal-footer">
  <h6 class="modal-title" id="modalLblBtm" style="color: rgb(0, 0, 255);">Booking No#</h6>
  <button type="button" class="btn btn-secondary btn-sm" data-bs-dismiss="modal">Close</button>                     
</div>

What class could be added to align both items vertically?

Appreciate if anybody could help on this!

like image 734
Nimal Avatar asked Dec 06 '25 04:12

Nimal


1 Answers

Use me-auto on the left button.

<div class="modal-footer">
     <button type="button" class="btn btn-primary me-auto">Save changes</button>
     <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>

For more info check: Post

like image 158
Divyesh_08 Avatar answered Dec 09 '25 00:12

Divyesh_08