Chrome doesn't apply padding to select options
P粉683665106
P粉683665106 2023-10-14 09:43:38
0
1
592

Select option fill not working in Chrome

<style>
select option { padding:5px 0px; }
</style>    
<select>
<option>1</option>
<option>2</option>
<option>3</option> 
</select>


P粉683665106
P粉683665106

reply all(1)
P粉420868294

I just found a way to apply padding to a select input in chrome

select{
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding: 5px;
}

Seems to work in current chrome 39.0.2171.71 (64 bit) and safari (I've only tested on Mac).

This appears to remove the default style added to the select input (it also removes the dropdown arrow), but allows you to use your own style without Chrome overriding it.

I stumbled across this fix while using code from here: http://fettblog.eu/style-select-elements/

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template