Background color of option when selected

Discussion in 'CSS' started by stephan2307, Mar 29, 2010.

  1. #1
    I have this css :
    option:hover {
            background-color : #336600;
            color : #ffffff;
        }
    HTML:
    This changes the backgrund color when I hover over an option in a select element. When I select an option it changes back to blue and I can't find a way to change this. Anyone got any idea?
     
    stephan2307, Mar 29, 2010 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #2
    Option - by the CSS specification, does not accept style. I believe firefox will incorrectly apply this, but don't count on it ever working in any other browser. Like most form elements, the specification doesn't say how ANY of them are supposed to accept style, if at all - so every browser maker went their own direction making them all behave and appear differently...

    Basically, your **** outta luck.
     
    deathshadow, Mar 30, 2010 IP