Jump to content

Color in a select box


umekille78
 Share

Recommended Posts

Hi all good people!I have a litle problem. I want to putt color into a select box like this:

<select name=fontcolor size=1><option value=black SELECTED>Svart<option value=blue><font color=blue>Blå</font><option value=red><font color=red>Röd</font><option value=green><font color=green>Grön</font><option value=purple><font color=purple>Lila</font><option value=orange><font color=orange>Orange</font><option value=aqua><font color=aqua>Aqua</font><option value=fuchsia><font color=fuchsia>Fuchsia</font><option value=gray><font color=gray>Grå</font><option value=lime><font color=lime>Lime</font><option value=maroon><font color=maroon>Maroon</font><option value=navy><font color=navy>Marin</font><option value=olive><font color=olive>Oliv</font><option value=silver><font color=silver>Silver</font><option value=teal><font color=teal>Teal</font><option value=yellow><font color=yellow>Gul</font></select>

But that dont work :) I have also tryed to put the color atribut into the option like this:

<option color=olive value=olive>Oliv

But that dont work for me either.Does any of you know a way to get the color inte the select box?/Per

Link to comment
Share on other sites

try this:<option value="red" style="background-color:#00FF00">Röd</option><option value="green" style="background-color:#FF0000">Grön</option><option value="yellow" style="background-color:#FFFF00">Gul</option>OR<option value="red" style="color:#00FF00">Röd</option><option value="green" style="color:#FF0000">Grön</option><option value="yellow" style="color:#FFFF00">Gul</option>and make sure you close your <option> tag after each item.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...