SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Jan 2001
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,

    Does anyone here know how I can change the highlight color of a selected item in a drop down menu using CSS?

  2. #2
    SitePoint Member
    Join Date
    Feb 2001
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  3. #3
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    VirtueTech...

    This is what you are looking for:

    <style type="text/css">
    <!--

    option { color: #cc0000; background-color: #000000; }
    .another { color: #00000; background-color: #33ff00; }

    -->
    </style>

    The first example (OPTION) will apply to every instance of the OPTION tag, no further coding is needed.

    If you wanted to apply a style to only one OPTION tag, then you would use the second example (.another) and do this:

    <select>
    <option>this is a test</option>
    <option class="another">Another test</option>
    <option>One last test</option>
    <option>One last test</option>
    <option>One last test</option>
    <option>One last test</option>
    </select>

    Is that clear?
    Last edited by creole; Apr 12, 2001 at 11:38.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  4. #4
    SitePoint Member
    Join Date
    Jan 2001
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes but it does not change the color of the SELECTED option or the option the user has highlighted.

    How do I change that?

  5. #5
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ah...I don't believe you can change that as that is a Windows API thing (I think).

    I am pretty sure that you will have no luck there...
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  6. #6
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol..juz to add some..
    hey..( pardon me..trying to raise my post count...juz joking..ahah )

    you could add other properties..like font family, size and more.
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein


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
  •