| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Drop Down List and CSS
Is it possible to have each item in a <select><option> tag set to have a different background color?
Thanks for any help, Chris ~`^% |
|
#2
|
||||
|
||||
|
yes it is, i show you how
EXAMPLE: Code:
<head>
<style>
option.option_select_ok {
color:green
}
option.option_select_nok {
color:red
}
</style>
</head>
<body>
<select name="select_box">
<option <%If RS("defined") = true Then%>class="option_select_ok"<%ElseIf RS("defined") = false Then%>class="option_select_nok"<%End If%> value="">optiontext</option>
</select>
</body>
|
|
#3
|
||||
|
||||
|
this example is coloring the text of the option, but you can do the same with background color by using:
Code:
background-color: ............... when you wanne make it dynamic, you have to randomize the colors with ASP's randomize / rnd() function Last edited by leuvenaar : September 22nd, 2005 at 01:44 PM. |
![]() |
| Viewing: ASP Free Forums > Web Design > Web Layout > Drop Down List and CSS |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|