-1

is there a possiblity to change the selection color in a box? I can only find answears how to change the color on hover, but i want to change the background-color of all selected items.

i tried this selectors:

option[selected]{
    background-color: red;
}

option:checked{
    background-color: red;
}

but i had no luck

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
wutzebaer
  • 14,365
  • 19
  • 99
  • 170
  • 1
    See http://stackoverflow.com/questions/8619406/css-selected-pseudo-class-similar-to-checked-but-for-for-select-elements http://stackoverflow.com/questions/9309844/can-i-colour-backgrounds-of-selected-items-in-html-select-options-with-css-only – BoltClock Mar 09 '12 at 12:22
  • If there was a badge for the most removals of `css3` tags, @BoltClock would get it – Curtis Mar 09 '12 at 12:23
  • 1
    @Curt: Relevant commentary - http://stackoverflow.com/election/2#post-8043622 – BoltClock Mar 09 '12 at 12:29
  • Maybe you tested in a browser, that does not support this pseudo-selector? – yunzen Mar 09 '12 at 13:53

1 Answers1

0

if u want a custom colored/styled checkbox ,the best way for cross browser compatibility and version compatibility is designing your own checkbox button with an image. then create a hidden checkbox and trigger its properties via the custom checkbox. events like onmouseover, onmouseout, onkeydown, onkeyup, onclick etc will help u to exaxtly simulate the functions and behaviour of a regular checkbox, but fully customizable.

brizz
  • 129
  • 3