I'm using Bootstrap's btn-mini
class for "mini" buttons and am looking for something analogous to create a "mini" select element, where the select button (i.e. the part you click to show the list of options, not the list of options itself) is the same size and style as a mini button.
When I apply the btn-mini
class to a select element, the font style of the select button is the same size as a mini button, but the size of the select button itself is unchanged from the default size.
Is there a different Bootstrap class I should use? Or another way to do it?
P.S. I'm working on OS X Chrome, but naturally hope there is a cross-browser compatible solution.
Just in case any Bootstrap 3 users come across this old question, here's the BS3 way:
<select class="form-control input-lg"></select> <select class="form-control"></select> <select class="form-control input-sm"></select> <input class="form-control input-lg"> <input class="form-control"> <input class="form-control input-sm">
There is no input-xs, though, so you'd have to make that yourself if you wanted smaller.
.input-xs, select.input-xs { height: 20px; line-height: 20px; }
<select class="btn btn-mini"> <!-- options --> </select> <span class="caret"></span>
select.btn-mini { height: auto; line-height: 14px; } /* this is optional (see below) */ select.btn { -webkit-appearance: button; -moz-appearance: button; appearance: button; padding-right: 16px; } select.btn-mini + .caret { margin-left: -20px; margin-top: 9px; }
The last 2 rules are optional, it will make <select>
look like <button>
, I've also added a caret to it. See this fiddle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With