0

I dont want it like in http://jsfiddle.net/zNTqm/287/. I want to style the shown selected element

<select class="mySelect">
<option value="1" selected="selected">1</option> <---- the shown element should be RED 
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>

Domi
  • 1,299
  • 3
  • 17
  • 27
  • possible duplicate of [How to style a – αƞjiβ Dec 19 '14 at 14:57

1 Answers1

1

you can't style 'option' tags like that, plus you only see the selected option anyway, so you could try

div class='hightlight'>
 [select code goes here]
</div>

Then style the background of your highlight div (making sure its bigger then the select so its nice and noticable. Or you could add a border to the select to show an option has been selected etc

atmd
  • 7,430
  • 2
  • 33
  • 64
  • this is what i thought : a div with a color which depends on the selection event, i thought there is a css option to stlye the selected directly without a div, guss not – Domi Dec 19 '14 at 15:00
  • its more that you can not style a native option tag in css, you'd have to either style another element and use that to fake the option tag or style the select (which only allows some styling options) – atmd Dec 19 '14 at 15:01