2013-08-06 52 views
6

我在写一个带有几个选项和颜色的下拉菜单。我已成功着色每个选项的背景;但是,一旦选择了背景颜色不显示。

有没有办法改变这种行为?我下面的HTML的例子:

所选选项的背景颜色

<select> 
    <option style="background-color: green">Successful</option> 
    <option style="background-color: orange">Process Failure</option> 
    <option style="background-color: purple">Abandoned</option> 
</select> 

或也在这里:http://jsfiddle.net/H8HVm/1/

谢谢!

+0

我想你需要javscript操作来做到这一点。 – mshsayem

+0

您还需要将'background-style'应用于'