#1
  1. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Apr 2000
    Posts
    1,058
    Rep Power
    22

    CSS and Select boxes


    Is there anyway to control the color of the dark blue focus bar in a form's select element. I tried using onFocus in a few creative ways but was unable to change the color of the focus bar. It did seem that each option was able to be addressed for focus individually so I haven't lost hope that this can be controlled.

    Any thoughts?

    wdn2k
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Nov 2001
    Posts
    1,882
    Rep Power
    20
    Here is an example:
    Code:
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    <!--
    select {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #00CC00; text-decoration: none; background-color: #666666}
    -->
    </style>
    </head>
    
    <body bgcolor="#FFFFFF" text="#000000">
    <form name="form1" method="post" action="">
      <select name="select">
        <option value="item1">item1</option>
        <option value="item2">item2</option>
        <option value="item3">item3</option>
      </select>
    </form>
    </body>
    </html>
    Is this what you meant?
  4. #3
  5. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Apr 2000
    Posts
    1,058
    Rep Power
    22

    Re: CSS and Select boxes


    Not exactly.

    I know how to control the background and text color. What I'm struggling with is controlling the color of the option that the mouse is currently selecting.

    Thank you for your response though.

    wdn2k
  6. #4
  7. superficial
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    Peterborough, England
    Posts
    188
    Rep Power
    13
    look at the css spec on webref

    that will tell you if there is such an attribute and which browsers it works for.

    Matt
    _______________
    Matt
  8. #5
  9. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Apr 2000
    Posts
    1,058
    Rep Power
    22
    That's an interesting site, and I even bookmarked it for future reference, but it doesn't have it's CSS info organized in a way that is helpful for finding the answer I'm looking for. For example, it lists properties, but doesn't say which elements they apply to. What would be helpful is a resource that lists all the properties of a given element.

    I've been looking all over for an answer to this question, and I'm beginning to think either (a) it can't be done, or (b) I'm the only person that ever wanted to try it.


    wdn2k
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Nov 2001
    Posts
    1,882
    Rep Power
    20
    What I'm struggling with is controlling the color of the option that the mouse is currently selecting.
    I don't think it can be done.
  12. #7
  13. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Oct 2001
    Location
    New Zealand
    Posts
    1,774
    Rep Power
    25
    Depending on what browser your aiming at you could modify this:

    And yet more code... a picture select box

IMN logo majestic logo threadwatch logo seochat tools logo