Home > Software engineering >  Bootstrap 5: Change height/use padding for option element
Bootstrap 5: Change height/use padding for option element

Time:05-09

I wish to change the height or increase padding-top padding-bottom of the option element in a normal select box when using Bootstrap 5: https://getbootstrap.com/docs/5.0/forms/select/

How is this possible? Example code:

<select  aria-label="Default select example">
  <option selected>Open this select menu</option>
  <option value="1">One</option> <!--  does not work -->
  <option value="2">Two</option>
  <option value="3">Three</option>
</select>

Thanks!

CodePudding user response:

Custom menus need only a custom class, .form-select to trigger the custom styles. Custom styles are limited to the ’s initial appearance and cannot modify the s due to browser limitations.

quote from Bootstrap website

It is basically not possible link. You can use plugins in your code pr use dropdown instead of select.

  • Related