The css style for option value into the html drop down list not work on chrome and safari , work only on Firefox and IE.
some of code are out below:
<option style="color:#4f5652;background:#f0f0ef;hite-space:nowrap;-webkit-appearance:button;text-overflow:ellipsis; padding:5px 4px 3px 4px;border-bottom:1px solid green" value="project">Project</option>
I was able to replicate this in Chrome on jsfiddle. You can apply the styles to
select
, like this: http://jsfiddle.net/aaronmacy/3uv8D/color
style works fine in<option>
elements on Windows 7 with current versions of Chrome, Safari, Firefox, IE, and Opera, as well as on Mac with Firefox; but appears to be a no-op on Mac with Chrome and Safari. Seems like a bug to me.The short answer - you can not do that in Webkit based browsers. I.e. about
padding
take a look hereTo overcome your problem you can change your
<select>
to a list<ul>
and style its'<li>
items. That will work in every browser guaranteed.try it
as we can see in: http://www.w3schools.com/tags/att_option_value.asp
Please try to use this