<select class="custom-select">
<option selected>Open this select menu</option>
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
Click one of the examples listed below to open the Shuffle Visual Editor with the UI library that uses the selected component.
You don't need to remember all CSS classes. Just use the Bootstrap Editor instead.
/* _custom-forms.scss:164 */
.custom-select {
display: inline-block;
width: 100%;
height: $custom-select-height;
padding: $custom-select-padding-y ($custom-select-padding-x + $custom-select-indicator-padding) $custom-select-padding-y $custom-select-padding-x;
line-height: $custom-select-line-height;
color: $custom-select-color;
vertical-align: middle;
background: $custom-select-bg $custom-select-indicator no-repeat right $custom-select-padding-x center;
background-size: $custom-select-bg-size;
border: $custom-select-border-width solid $custom-select-border-color;
@if $enable-rounded {
border-radius: $custom-select-border-radius;
} @else {
border-radius: 0;
}
@include box-shadow($custom-select-box-shadow);
appearance: none;
&:focus {
border-color: $custom-select-focus-border-color;
outline: 0;
@if $enable-shadows {
box-shadow: $custom-select-box-shadow, $custom-select-focus-box-shadow;
} @else {
box-shadow: $custom-select-focus-box-shadow;
}
&::-ms-value {
// For visual consistency with other platforms/browsers,
// suppress the default white text on blue background highlight given to
// the selected option text when the (still closed) <select> receives focus
// in IE and (under certain conditions) Edge.
// See https://github.com/twbs/bootstrap/issues/19398.
color: $input-color;
background-color: $input-bg;
}
}
&[multiple],
&[size]:not([size="1"]) {
height: auto;
padding-right: $custom-select-padding-x;
background-image: none;
}
&:disabled {
color: $custom-select-disabled-color;
background-color: $custom-select-disabled-bg;
}
// Hides the default caret in IE11
&::-ms-expand {
opacity: 0;
}
}
/* _custom-forms.scss:431 */
.custom-select {
@include transition($custom-forms-transition);
}
/* _forms.scss:305 */
.custom-select {
width: auto;
}
/* _forms.scss:54 */
.custom-select {
.was-validated &:#{$state},
&.is-#{$state} {
border-color: $color;
&:focus {
border-color: $color;
box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
}
~ .#{$state}-feedback,
~ .#{$state}-tooltip {
display: block;
}
}
}
Code copied to the clipboard.
Copying failed
/* _custom-forms.scss:164 */
$custom-select-height
$custom-select-padding-y
$custom-select-padding-x
$custom-select-indicator-padding
$custom-select-padding-y
$custom-select-padding-x
$custom-select-line-height
$custom-select-color
$custom-select-bg
$custom-select-indicator
$custom-select-padding-x
$custom-select-bg-size
$custom-select-border-width
$custom-select-border-color
$enable-rounded
$custom-select-border-radius
$custom-select-box-shadow
$custom-select-focus-border-color
$enable-shadows
$custom-select-box-shadow
$custom-select-focus-box-shadow
$custom-select-focus-box-shadow
$input-color
$input-bg
$custom-select-padding-x
$custom-select-disabled-color
$custom-select-disabled-bg
/* _custom-forms.scss:431 */
$custom-forms-transition
/* _forms.scss:305 */
/* _forms.scss:54 */
$state}
$state}
$color
$color
$input-focus-width
$color
$state}-feedback
$state}-tooltip