I want to style my option tag. I want to set its height and its padding but it doesn't work. I tried to change option's background and this worked well but the height and the padding don't. Here is my HTML code:
<select id="from_currency" >
<option value="AED">AED</option>
<option value="ARS">ARS</option>
<option value="AUD">AUD</option>
<option value="BGN">BGN</option>
<option value="BRL">BRL</option>
</select>
And CSS:
option{
padding:20px;
height:40px;
}
But these styles doesn't work.
There is limited styling capability for
<option>
, as this element is an Operating System element. For better styling of<option>
use plugins. For example this plugin (jquery is required). But you can style the selected element in this way -option[selected]
. I have provided some examples of how you can style your<option>
. Perhaps these are not all possible options.