VOOZH about

URL: https://www.geeksforgeeks.org/bootstrap/bootstrap-5-select-default/

⇱ Bootstrap 5 Select Default - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Bootstrap 5 Select Default

Last Updated : 10 Apr, 2024

Bootstrap 5 Select Default stylizes dropdown menus, enhancing user experience. However, limitations exist in modifying option styles due to browser constraints, despite offering various customization options for select elements.

Bootstrap 5 Select Default Class:

  • form-select: This class is used to trigger the select option styles of Bootstrap 5.

Syntax:

<select class="form-select">
<option value="...">Option1</option>
...
</select>

Below examples illustrate the Bootstrap 5 Select Default:

Example 1: In this example, we used the Bootstrap 5 select element by applying the form-select class to the HTML <select> element.

Output:

👁 Image
Bootstrap 5 Select Default

Example 2: In this example, we used the select attribute of the select any particular option as default.

Output:

👁 Image
Bootstrap 5 Select Default
Comment

Explore