Mac & IE: background color for select elements (or the options within) using CSS/Style

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • James

    Mac & IE: background color for select elements (or the options within) using CSS/Style

    I'm trying to make a select box where each of 3 elements shows up as a
    different color. I've gotten it working on the PC, but seem to be
    having some troubles with the Mac/IE combo.

    Apparently Mac users don't see the background color(s) when they
    open the select box tab.

    I've tried a couple different ways, but haven't managed to make it
    work (though I believe on Mac/Netscape it works). Some code below...I
    tried both using classes and setting the style directly on the option
    elements.

    If someone can show/explain how to make a mac/IE (5.2) combo show
    background color(s), or point me at a site wher it works that'd be
    great.

    Thanks a lot,
    -James
    =============== =============== =============== =============== ===
    <style type="text/css">
    ..selectStyleNe utral {
    background-color: white;
    }
    ..selectStyleRe d {
    background-color: red;
    }
    ..selectStyleBl ue {
    background-color: Blue;
    }
    </style>
    <select name="foo2">
    <option value="" class="selectSt yleNeutral">&nb sp;</option>
    <option value="1" class="selectSt yleBlue">&nbsp; </option>
    <option value="2" class="selectSt yleRed">&nbsp;</option>
    </select>
  • brucie

    #2
    Re: Mac &amp; IE: background color for select elements (or the options within) using CSS/Style

    In post <2ff5d202.03080 21119.57015b68@ posting.google. com>
    James said...
    [color=blue]
    > I'm trying to make a select box where each of 3 elements shows up as a
    > different color. I've gotten it working on the PC, but seem to be
    > having some troubles with the Mac/IE combo.[/color]

    browser support for styling form elements varies and some
    implementations are a little odd. for example:

    with opera option{color:re d;} doesn't color the <option> text red but
    select{color:re d;} does. with mozilla option{color:re d;} colors the
    first <option> the color of the <select> but the other <options> are
    red. in IE all the <options> are red.

    --
    brucie a. blackford. 03/August/2003 09:40:49 am kilo.

    Comment

    Working...