Color in OPTION elements

They have: 6 posts

Joined: May 2000

Hi,

I need to set the first option in my select list to a different color.
Is it possible?
Thank you for help..

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

<option style="color:#hexhex;"> in the tag you want to change, replace hexhex with the actual hex code of the colour.

___________________________

If you are doing this all over a site, set up a class in CSS...
<head>
<style type="text/css">
<!--

.first {color: #hexhex;}

//-->
</style>
</head>

<body>

<option class="first">

_____________________________

hth,

Suzanne

------------------
Zero Cattle
Suzanne
Tables DeMystified

They have: 6 posts

Joined: May 2000

Thank you Suzanne,

I've forgot to say that i'me using that with Netscape.. for Explorer I manipulate table to show my data like Grid...

Netscape doesn't support STYLE attribute in SELECT element !!! or I'me wrong ??

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

You can have style in any element, but if you look above, you should have the attribute style in the OPTION tag, not the SELECT tag.

However, you are correct that Netscape won't change the colour. It will change the font-size and the font-family, though. www.zerocattle.com/examples/blogger.html -- if you check with Netscape and then IE you will see one of the drop-down menus has an orange title in IE, not in Netscape, but otherwise they both have a smaller than default font-size and use verdana as the font-family. *sigh* Such is life in a world without standards.

I have collected a pile of links about CSS on my site ( www.carterjackson.com/index/links.htm#css ) and there is a link there to the Master Grid where they have collected all the glitches with Netscape and IE on both Operating systems (different versions) and you may find the support issue there.

hth,

Suzanne

------------------
Zero Cattle
Suzanne
Tables DeMystified

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.