theotherguy priority asked 3 years ago

Expected behavior When I replace the content of a button with less content I want the button to stay the same size. Actual behavior When I replace the html of a button with content, the button resizes to fit the content.

Resources (screenshots, code snippets etc.) $("#button").html("new");

Michal Szymanski staff answered 3 years ago

It's natural and a desire to behave a button.

If you want to have a fixed width you need some additional CSS, for example:

        .btn-fixed {
          min-width: 70px;
          min-height: 36px;

      <button type="button" class="btn btn-primary btn-fixed"></button>

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: 1.0.0
  • Device: any
  • Browser: any
  • OS: any
  • Provided sample code: No
  • Provided link: No