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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set style to <OPTION> in <SELECT>?

Status
Not open for further replies.

correro

Programmer
Nov 20, 2003
54
0
0
CN
In a drop-down list created with <select><option>, is it possible to set style to the options? Like, say, different background color, or font color?
 
Hi mate,

The following will change the background colours:

Code:
<style>
option.red { 
        background: #FC6165; 
        } 
option.green { 
        background: lightgreen; 
        } 
</style>

                    <select name="test">
					<option>Normal
					<option class="green">Green
					<option class="red">Red
					</select>

Wullie

Fresh Look - Quality Coldfusion Hosting

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top