Jump to content

How to Set the selection color in html?


manojdubey

Recommended Posts

Hi I got the following code <select> <option style="background-color:yellow; padding:10px;"> Yellow</option><option style="background-color:green; padding:10px;" >green</option><option style="background-color:blue; padding:10px;" >blue</option><option style="background-color:red; padding:10px;" >red</option></select>The code creates a select box with options in different colors. But when I select the options that color gets hidden by the selection color eg. blue. I want to avoid this. If anybody can help?Manoj Dubey

Link to comment
Share on other sites

this is the changes i did. just copy and paste.if you want you can change#FFFFFF to the text value White Or any other colors. :)

<select><option style="background-color:yellow; padding:10px;"> Yellow</option><option style="background-color:green; padding:10px;  color:#FFFFFF;" >Green</option><option style="background-color:blue; padding:10px; color:#FFFFFF;" >Blue</option><option style="background-color:red; padding:10px" >Red</option></select>

Note:///////////I also made the text white for the green one aswell cause it was alittle difficult to read aswell as the blue one

Link to comment
Share on other sites

ThanQ Mimika,But you somewhere misunderstood my problem. I don`t want to make the content just visible rather I want to see the whole content to look in same color irrespective of whether it is selected or not. Actually I am preparing a color chooser for the my page .ThanksManoj

Link to comment
Share on other sites

ahh now i get it :)I am might be to inexperianced with the select/option codes if you want the hover to be dissabled.. sorry

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
×
×
  • Create New...