CodeBlessU
learn code with examples

Bootstrap Forms Select

Example links are referring to Bootstrap official site.

Bootstrap 5 Forms Select

This example shows usage of class="form-select" for HTML select tag.

  • Use class="form-select" for select. Example
  • There are three sizing:
    • class="form-select" (Normal)
    • class="form-select form-select-lg" (Large)
    • class="form-select form-select-sm" (Small)
    Example
  • Due to browser limitations, there are no bootstrap classes for option tag within select.

  • Bootstrap class="form-select" recognizes following cases and defines/updates style for it.
    • If multiple attribute is present, it updates style.
    • If size attribute is present, it updates style.
    • If disabled attribute is present, it updates style. Example

<select class="form-select">
  <option selected>Select from...</option>
  <option value="1">One</option>
  <option value="2">Two</option>
  <option value="3">Three</option>
</select>

In this page...

Copyright © All rights reserved.