theotherguy priority asked 4 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 4 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:

      <style>
        .btn-fixed {
          min-width: 70px;
          min-height: 36px;
        }
      </style>

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


Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Answered

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