Thursday, December 31, 2009

In CSS or JavaScript, how do I change the highlight color for Selected Items? Is it even possible?

I'm working on a web page with a submission form, built with Select drop-down tags. I can change the background colors of the options but I also want to change the color of the highlight of the ';Selected Item'; which is based on the visitor's customization (usually Navy Blue) in Windows Display Properties.





So far, the only way to do this is for the user to go into Windows Display Properties -%26gt; Appearance -%26gt; Advanced -%26gt; Selected Items and change the color there.





Is there a Style or a Script that will do this solely on a web page form without the visitor having to make changes himself in Display Properties?





Thanks,


A.P.In CSS or JavaScript, how do I change the highlight color for Selected Items? Is it even possible?
Maybe I've misunderstood your question, but in the context of a browser, this should be a browser/user style, regardless the source from which it's retrieved. Have you tried attaching the !important directive to the style you want to apply?In CSS or JavaScript, how do I change the highlight color for Selected Items? Is it even possible?
You cannot change that mouse over color on %26lt;option%26gt;. It's a system property.
Sadly, that is something you cannot control as a designer. As you mentioned, it is set in the user's display settings, and that is the only way to change it.





CSS is super powerful, but there are still some limits. Perhaps in the next standard, it will be an option?





hold the phone... i might have found an answer! I'm gonna do some research... I'll edit my response in a few minutes.





EDIT: bah... its impossible. I guess it COULD be possible to design your own select box, using styled divs and javascript for showing/hiding content in a relatively positioned container... which is what a select box pretty much is, anyway... and you could choose your own colors for the individual select divs... but that would require a LOT of css and javascript, and I don't have the time nor the desire to write one right now. Perhaps someone already wrote one and posted it somewhere on this world wide web?





You could also write it yourself... you can find all necessary code snippets here: http://javascript.internet.com/ start with this one: http://javascript.internet.com/css/easy-鈥?/a> and go on from there.
  • ds browser
  • No comments:

    Post a Comment