In Chrome and Firefox, you can create an element optionif it selectis larger than 1.
You can use it as follows:
select {
height: 1.4em;
}
select:focus {
height: 100%;
}
option {
text-transform: lowercase;
padding-right: 2em;
display: none;
}
option::first-letter {
text-transform: uppercase;
}
option:checked, select:focus option {
display: block;
}
<select size="4">
<option selected>NOW IS THE TIME</option>
<option>for all good men</option>
<option>tO Come To tHe aid</option>
<option>of the party</option>
</select>
Run codeHide resultIt will not act like a regular selection box, and Chrome has a weird behavior, since the selected option will have a gray background. I can’t figure out how to prevent this.
source
share