SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2003
    Location
    California
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Different option Colors in a Select list box

    Hi

    Is it possible to change the color of the text from one select option to another?

    eg

    First option "Car" is red
    Second option "Cycle" is blue?

  2. #2
    SitePoint Addict xDev's Avatar
    Join Date
    Jul 2003
    Location
    Moncton, New Brunswick, Canada
    Posts
    247
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes

    HTML Code:
    <head>
    <style type="text/css">
    option.red {
    	color: red;
    }
    
    option.blue {
    	color: blue;
    }
    </style>
    </head>
    <body>
    <form>
    <select>
    <option class="red">Car</option>
    <option class="blue">Cycle</option>
    </select>
    </form>


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
  •