Background colour of Drop down list entry's?

H

harry

A client wants a drop down box on a web page that contains 3 list items
"red", "green" & "amber" - is it possible to set the background colour for
each individual item? - any ideas before I tell them no?

cheers

harry
 
D

David Dorward

harry said:
A client wants a drop down box on a web page that contains 3 list items
"red", "green" & "amber" - is it possible to set the background colour for
each individual item?

option.someClass { background-color: #aff; color: #ffa; }

- browser support is limited.
 
R

rf

harry said:
A client wants a drop down box on a web page that contains 3 list items
"red", "green" & "amber" - is it possible to set the background colour for
each individual item? - any ideas before I tell them no?

Tell him no.

Cheers
Richard.
 
B

brucie

in post: <
harry said:
A client wants a drop down box on a web page that contains 3 list items
"red", "green" & "amber" - is it possible to set the background colour for
each individual item? - any ideas before I tell them no?

#o1{background:red;}
#o2{background:green;}
#o3{background:#FFEA76;}

<option id="o1">blah 1</option>
<option id="o2">blah 2</option>
<option id="o3">blah 3</option>

etc etc

browser support varies. user options may also disallow styling of form
elements.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top