Bootstrap 5:更改选项元素的 height/use 填充

Bootstrap 5: Change height/use padding for option element

我希望在使用 Bootstrap 时更改普通 select 框中 option 元素的高度或增加 padding-top + padding-bottom 5: https://getbootstrap.com/docs/5.0/forms/select/

这怎么可能?示例代码:

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

谢谢!

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.

引自Bootstrap website

基本不可能link. You can use plugins in your code or use dropdown代替select.