Web Layout
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsWeb DesignWeb Layout

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 22nd, 2005, 01:13 PM
shadowspell's Avatar
shadowspell shadowspell is offline
I'm baack!!
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: In a suburb of Atlanta, GA, in front of the computer.
Posts: 161 shadowspell User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 2 h 35 m
Reputation Power: 5
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
~`^%

Reply With Quote
  #2  
Old September 22nd, 2005, 01:41 PM
leuvenaar's Avatar
leuvenaar leuvenaar is offline
Frustrated Wizard
ASP Free Regular (2000 - 2499 posts)
 
Join Date: Apr 2005
Posts: 2,408 leuvenaar User rank is Sergeant (500 - 2000 Reputation Level)leuvenaar User rank is Sergeant (500 - 2000 Reputation Level)leuvenaar User rank is Sergeant (500 - 2000 Reputation Level)leuvenaar User rank is Sergeant (500 - 2000 Reputation Level)leuvenaar User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 22 h 57 m 8 sec
Reputation Power: 14
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>

Reply With Quote
  #3  
Old September 22nd, 2005, 01:42 PM
leuvenaar's Avatar
leuvenaar leuvenaar is offline
Frustrated Wizard
ASP Free Regular (2000 - 2499 posts)
 
Join Date: Apr 2005
Posts: 2,408 leuvenaar User rank is Sergeant (500 - 2000 Reputation Level)leuvenaar User rank is Sergeant (500 - 2000 Reputation Level)leuvenaar User rank is Sergeant (500 - 2000 Reputation Level)leuvenaar User rank is Sergeant (500 - 2000 Reputation Level)leuvenaar User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 22 h 57 m 8 sec
Reputation Power: 14
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.

Reply With Quote
Reply

Viewing: ASP Free ForumsWeb DesignWeb Layout > Drop Down List and CSS


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT