Sep 13, 2004 #1 correro Programmer Joined Nov 20, 2003 Messages 54 Location 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?
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?
Sep 13, 2004 #2 Wullie Programmer Joined Mar 17, 2001 Messages 3,674 Location GB 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 http://www.tutorial-world.com The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell Upvote 0 Downvote
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 http://www.tutorial-world.com The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
Sep 13, 2004 Thread starter #3 correro Programmer Joined Nov 20, 2003 Messages 54 Location CN as simple as that! thanks wullie! Upvote 0 Downvote