mirror of
https://github.com/twbs/bootstrap.git
synced 2024-12-12 00:08:59 +01:00
63 lines
1.7 KiB
Markdown
63 lines
1.7 KiB
Markdown
|
---
|
||
|
layout: docs
|
||
|
title: Select
|
||
|
description: Customize the native `<select>`s with custom CSS that changes the element's initial appearance.
|
||
|
group: forms
|
||
|
toc: true
|
||
|
---
|
||
|
|
||
|
## Default
|
||
|
|
||
|
Custom `<select>` menus need only a custom class, `.form-select` to trigger the custom styles. Custom styles are limited to the `<select>`'s initial appearance and cannot modify the `<option>`s due to browser limitations.
|
||
|
|
||
|
{{< example >}}
|
||
|
<select class="form-select">
|
||
|
<option selected>Open this select menu</option>
|
||
|
<option value="1">One</option>
|
||
|
<option value="2">Two</option>
|
||
|
<option value="3">Three</option>
|
||
|
</select>
|
||
|
{{< /example >}}
|
||
|
|
||
|
## Sizing
|
||
|
|
||
|
You may also choose from small and large custom selects to match our similarly sized text inputs.
|
||
|
|
||
|
{{< example >}}
|
||
|
<select class="form-select form-select-lg mb-3">
|
||
|
<option selected>Open this select menu</option>
|
||
|
<option value="1">One</option>
|
||
|
<option value="2">Two</option>
|
||
|
<option value="3">Three</option>
|
||
|
</select>
|
||
|
|
||
|
<select class="form-select form-select-sm">
|
||
|
<option selected>Open this select menu</option>
|
||
|
<option value="1">One</option>
|
||
|
<option value="2">Two</option>
|
||
|
<option value="3">Three</option>
|
||
|
</select>
|
||
|
{{< /example >}}
|
||
|
|
||
|
The `multiple` attribute is also supported:
|
||
|
|
||
|
{{< example >}}
|
||
|
<select class="form-select" multiple>
|
||
|
<option selected>Open this select menu</option>
|
||
|
<option value="1">One</option>
|
||
|
<option value="2">Two</option>
|
||
|
<option value="3">Three</option>
|
||
|
</select>
|
||
|
{{< /example >}}
|
||
|
|
||
|
As is the `size` attribute:
|
||
|
|
||
|
{{< example >}}
|
||
|
<select class="form-select" size="3">
|
||
|
<option selected>Open this select menu</option>
|
||
|
<option value="1">One</option>
|
||
|
<option value="2">Two</option>
|
||
|
<option value="3">Three</option>
|
||
|
</select>
|
||
|
{{< /example >}}
|