Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change color of dropdown elements 3

Status
Not open for further replies.

Craftor

Programmer
Feb 1, 2001
420
NZ
Hi all

Is it possible for every item in a dropdown list to have a different back color or font color?

Thanks as always

Craftor
:cool:
 
Sure it is:
Code:
<select>
 <option style=&quot;background: red; color: blue;&quot;>value1</option>
 <option style=&quot;background: transparent; color: #aa0044;&quot;>value2</option>
 <option style=&quot;background: #999999; color: green;&quot;>value3</option>
</select>
Hope it helps. Don't run the code, the colors and combinations might be attrocious.
 
:) after saying that I had to check out how it looked!

Thanks for the help Vragabond!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top