The btn-block class to make a button extend the whole column width has been deprecated in Bootstrap 5. There are few alternatives to that class available.

Btn-block code examples for Bootstrap 5

  • The method recommended in the documentation for Bootstrap 5 is to add "d-grid" class to a <div> tag wrapping the <a> tag.
  • Alternative: add w-100 class to the <a> tag
  • Alternative: add d-block to the <button> or <a> tag

Button Documentation:

Because this is a result of moving from Bootstrap 4 to 5, if you make this change before August 3, it is recommended that you avoid publishing the page before August 3.