Skip to main content
Commonmark migration
Source Link

In some cases you can, but will be not crossbrowser for sure. This element is rendered by the OS, not HTML. It cannot be styled via CSS. There are replacement plug-ins that look like a SELECT, but are actually composed from regular HTML elements that CAN be styled.

From MSDN

Except for background-color and color, style settings applied through the style object for the option element are ignored. In addition, style settings applied directly to individual options override those applied to the containing select element as a whole.

So it will work for some Browsers and versions, but for Chrome will not. I can't find right now the specs.

###JS Solution

JS Solution

Most of the plugins out there convert <select> elements to <ol> and <option> elements into to <li>, so that you can style it with CSS. You could write your own, but I'm sure there are good stuff out there.

###Two options

Two options

In some cases you can, but will be not crossbrowser for sure. This element is rendered by the OS, not HTML. It cannot be styled via CSS. There are replacement plug-ins that look like a SELECT, but are actually composed from regular HTML elements that CAN be styled.

From MSDN

Except for background-color and color, style settings applied through the style object for the option element are ignored. In addition, style settings applied directly to individual options override those applied to the containing select element as a whole.

So it will work for some Browsers and versions, but for Chrome will not. I can't find right now the specs.

###JS Solution

Most of the plugins out there convert <select> elements to <ol> and <option> elements into to <li>, so that you can style it with CSS. You could write your own, but I'm sure there are good stuff out there.

###Two options

In some cases you can, but will be not crossbrowser for sure. This element is rendered by the OS, not HTML. It cannot be styled via CSS. There are replacement plug-ins that look like a SELECT, but are actually composed from regular HTML elements that CAN be styled.

From MSDN

Except for background-color and color, style settings applied through the style object for the option element are ignored. In addition, style settings applied directly to individual options override those applied to the containing select element as a whole.

So it will work for some Browsers and versions, but for Chrome will not. I can't find right now the specs.

JS Solution

Most of the plugins out there convert <select> elements to <ol> and <option> elements into to <li>, so that you can style it with CSS. You could write your own, but I'm sure there are good stuff out there.

Two options

Source Link

In some cases you can, but will be not crossbrowser for sure. This element is rendered by the OS, not HTML. It cannot be styled via CSS. There are replacement plug-ins that look like a SELECT, but are actually composed from regular HTML elements that CAN be styled.

From MSDN

Except for background-color and color, style settings applied through the style object for the option element are ignored. In addition, style settings applied directly to individual options override those applied to the containing select element as a whole.

So it will work for some Browsers and versions, but for Chrome will not. I can't find right now the specs.

###JS Solution

Most of the plugins out there convert <select> elements to <ol> and <option> elements into to <li>, so that you can style it with CSS. You could write your own, but I'm sure there are good stuff out there.

###Two options