To ensure a select
element is not in multi-selection mode, simply remove the multiple
attribute altogether. Even if you try setting it to multiple="no"
or multiple="false"
, the standard behavior remains the same as HTML multiple
or XHTML's multiple="multiple"
. For further details, check out the information on the HTML spec page.
You can use the CSS3 :not()
selector to target any select
element without that attribute:
select:not([multiple]) {
height: 30px;
}
If you require support for IE7 and above, you can set the height for all select
elements first and then adjust it for those with the multiple
attribute:
select {
height: 30px;
}
select[multiple] {
height: auto;
}