SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2005
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Changing default hover color for select element?

    Is there a way to style the hover color for a select box element? I know I can style the bg color, font color, borders, etc. but is it even possible to style the on-hover color in the select box? Any feedback will be greatly appreciated.

  2. #2
    SitePoint Wizard bronze trophy Tyssen's Avatar
    Join Date
    Oct 2005
    Location
    Brisbane, QLD
    Posts
    4,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you tried select:hover { color: ? } That may work in some browsers, won't work in IE<=6 without js because they don't accept :hover except on anchors and even then probably won't work. There's some aspects of form styling that just won't work cross browser.

  3. #3
    SitePoint Zealot
    Join Date
    Apr 2005
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Tyssen
    Have you tried select:hover { color: ? } That may work in some browsers, won't work in IE<=6 without js because they don't accept :hover except on anchors and even then probably won't work. There's some aspects of form styling that just won't work cross browser.
    Tyssen - thanks for the reply. Unfortunately, select:hover { color: ? } affects the text color while select:hover { background-color: ? } affects the bg color of all of the options in the select box. What I am trying to affect is the blue hover color that is present when an item in the select box has the cursor over it.

  4. #4
    SitePoint Wizard bronze trophy Tyssen's Avatar
    Join Date
    Oct 2005
    Location
    Brisbane, QLD
    Posts
    4,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Then you want to apply the :hover to option instead. As I said though, this doesn't work in all browsers.

  5. #5
    SitePoint Zealot
    Join Date
    Apr 2005
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Tyssen
    Then you want to apply the :hover to option instead. As I said though, this doesn't work in all browsers.
    Unfortunately, option:hover { background-color: #FF0000; } does not work in IE6 or FF2.0. If you have any other ideas I would be interested. Any additional feedback will be appreciated. Thanks for your time.

  6. #6
    SitePoint Wizard bronze trophy Tyssen's Avatar
    Join Date
    Oct 2005
    Location
    Brisbane, QLD
    Posts
    4,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Like I said, when it comes to options/selects there are no reliable cross-browser methods for achieving what you want.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •