select list and CSS


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: select list and CSS

  1. #1
    Preeti Guest

    select list and CSS


    Hi friends

    I want to add background color in drop down list and even I wanna change
    the font color which comes in the drop down .. I tried to use <font> tag
    but it does not work inside the DROP DOWN LIST .. so please tell me how to
    do it ... Any help would be great ...
    waiting for a reply
    Preeti

  2. #2
    Russell Jones Guest

    Re: select list and CSS

    You should use CSS to format the control. Here's an example, tested in IE 5.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title></title>
    </head>
    <body>
    <SELECT id="Select1" size="1" name="Select1" style="background: blue;
    color: red; width:150px">
    <OPTION selected>
    Item 1</OPTION>
    <OPTION>
    Item 2</OPTION>
    <OPTION style="color:black">
    Item 3</OPTION>
    </SELECT>
    </body>
    </html>

    Russell Jones
    Sr. Web Development Editor
    DevX.com

    "Preeti" <preetisikri@hotmail.com> wrote in message
    news:3b82878d$1@news.devx.com...
    >
    > Hi friends
    >
    > I want to add background color in drop down list and even I wanna change
    > the font color which comes in the drop down .. I tried to use <font> tag
    > but it does not work inside the DROP DOWN LIST .. so please tell me how to
    > do it ... Any help would be great ...
    > waiting for a reply
    > Preeti




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center