tags:

views:

257

answers:

2

I have a regular html select field. When a user selects an item from the list, it is added to a multiple select field and marked as selected. If the user clicks on one of the items in the multiple select field it is removed. What I want to do is override the default colors of the multiple select field so that selected items have a black background.

I tried using css and the option[selected] tag but that doesn't seem to work. I can easily change the background color of the select box but not the individually selected items. What do I need?

+1  A: 

Maybe this article will get you going in the right direction:

http://www.456bereastreet.com/lab/styling-form-controls-revisited/select-multiple-option/

Cory Larson
+1  A: 

Only some browsers have support for the [selected] rule, you can simulate the behavior using some plugin like this combobox plugin

Eduardo Molteni