Background colour of Drop down list entry's?

Discussion in 'HTML' started by harry, May 31, 2004.

  1. harry

    harry Guest

    A client wants a drop down box on a web page that contains 3 list items
    "red", "green" & "amber" - is it possible to set the background colour for
    each individual item? - any ideas before I tell them no?

    cheers

    harry
     
    harry, May 31, 2004
    #1
    1. Advertisements

  2. option.someClass { background-color: #aff; color: #ffa; }

    - browser support is limited.
     
    David Dorward, May 31, 2004
    #2
    1. Advertisements

  3. harry

    rf Guest

    Tell him no.

    Cheers
    Richard.
     
    rf, May 31, 2004
    #3
  4. harry

    brucie Guest

    in post: <
    #o1{background:red;}
    #o2{background:green;}
    #o3{background:#FFEA76;}

    <option id="o1">blah 1</option>
    <option id="o2">blah 2</option>
    <option id="o3">blah 3</option>

    etc etc

    browser support varies. user options may also disallow styling of form
    elements.
     
    brucie, May 31, 2004
    #4
  5. harry

    harry Guest

    thanks chaps, works perfectly!

     
    harry, May 31, 2004
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.