Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Mar 2012
    Posts
    91
    Thanks
    2
    Thanked 0 Times in 0 Posts

    can disabled option colour be changed

    Hi All,

    In a web page menu option you can disable an option to use it as a heading say, I have no problem with that.

    <option value="spider" disabled="disabled">Spider</option>

    The default colour that IE shows for the disabled option is a very light Gray. Is it possible to change that colour via CSS or other code to make the colour blue.

    Martin.

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,607
    Thanks
    6
    Thanked 997 Times in 970 Posts
    Try
    Code:
    option[disabled] {color: whatever;}

  • #3
    New Coder
    Join Date
    Mar 2012
    Posts
    91
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Hi VIPStephan,

    Thanks for the suggestion.
    Not tried that way, but it did not work either.

    Martin.

  • #4
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,592
    Thanks
    0
    Thanked 645 Times in 635 Posts
    It makes no sense to disable an <option> to use as a heading when the <optgroup> tag provides that functionality without needing to be disabled.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

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