473,386 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Drop down list using CSS

Can any one tell me how to add style to drop down menu. Css styles like changing border color, background color , giving alternate color in the options etc.
Feb 19 '08 #1
5 1917
harshmaul
490 Expert 256MB
Have you already made the drop down using css or do you need to know how to do it?
Feb 19 '08 #2
Have you already made the drop down using css or do you need to know how to do it?
Hi,
I want to know how to use it and if possible how can we have multiple levels it it. for e.g.

Section A( as heading)
option 1 (as option under section A)
option 2 (as option under section A)
Section B( as heading)
option 1 (as option under section B)
option 2 (as option under section B)
Feb 22 '08 #3
harshmaul
490 Expert 256MB
Hi Try this

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"></meta>
  5. <title>css hover</title>
  6. <style type="text/css">
  7. #menu ul .item{display:none;}
  8. #menu ul:hover .item{display:block;}
  9. #menu ul{float:left;list-style:none;}
  10. </style>
  11.  
  12. </head>
  13. <body>
  14. <div id="menu">
  15. <ul>
  16. <li class="top">My affiliates</li>
  17. <li class="item"><a href="http://www.google.com/">google</a></li>
  18. <li class="item"><a href="http://www.thescripts.com/">theScripts</a></li>
  19. </ul>
  20. <ul>
  21. <li class="top">My News Articles</li>
  22. <li class="item"><a href="#">Story 1</a></li>
  23. <li class="item"><a href="#">Story 2</a></li>
  24. <li class="item"><a href="#">Story 1</a></li>
  25. <li class="item"><a href="#">Story 2</a></li>
  26. </ul>
  27. </div>
  28. </body>
  29. </html>
Feb 22 '08 #4
try the followng code for adding color for the drop down by using CSS

Expand|Select|Wrap|Line Numbers
  1.  
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
  3. "http://www.w3.org/TR/html4/strict.dtd">
  4.  
  5. <HTML>
  6. <HEAD> <TITLE> CSS Example </TITLE>
  7.  
  8. <style type="text/css">
  9. .altTextField {
  10. background-color: lightblue;
  11. font-family: verdana;
  12. font-size: 09pt;
  13. color: red
  14. height: 5pt
  15. width:6pt
  16. border:0px;
  17. }
  18. </style> 
  19.  
  20. </HEAD>
  21. <BODY>
  22. <FORM name="example" action="" method="POST" >
  23.  
  24. DropDown        :    <SELECT size=1 width=10 name=dropMenu class="altTextField"> 
  25.                 <option value=0>Option-1</option>
  26.                 <option value=1>Option-2</option>
  27.                 <option value=2>Option-3</option>
  28.                         </SELECT>
  29.  
  30. </FORM>
  31. </BODY>
  32. </HTML>
  33.  
  34.  
Feb 23 '08 #5
harshmaul
490 Expert 256MB
Hi everybody!
LOL, i just realised that theres more than one type of drop down. Poster please specify which one you want!

the one i wrote is for a menu navigation system, And the one the other poster wrote was for form submission.

Choose you weapon!
Feb 23 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Miguel Dias Moura | last post by:
Hello, i have an ASP.NET / VB page where i have a few 4 groups of Drop Down Lists. Each group of Drop Down Lists include 3 Drop Down Lists for date such as: DAY, MONTH, and YEAR. I don't want...
13
by: Leszek Taratuta | last post by:
Hello, I have several drop-down lists on my ASP.NET page. I need to keep data sources of these lists in Session State. What would be the most effective method to serialize this kind of data...
2
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will...
2
by: Dave A | last post by:
I am stuggling with databinding a drop down list, hooking into the SelectedIndexChanged and attempting to avoid using the viewstate. The drop down list is quite large so I would prefer to avoid...
8
by: Ed Dror | last post by:
Hi there ASP.NET 2.0 VB & SQL Express Lest take Northwind Categories Products as example I create a table that hold these two together and I create a stored procedure like select ProductID,...
5
by: ashok893 | last post by:
I'm using two drop down list ina form. I have generated the first drop down list from MySQL database. When i select an option from first drop down list, i have to generate second drop down list...
4
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me...
3
by: penny111 | last post by:
Hi there, For my application, i need to have 3 drop down lists 1. drop down list of folder names 2. drop down list of documents in the folder selected 3. drop down list of instances of the...
8
by: dskanth | last post by:
I have 4 drop down lists, namely Location, country, State and City. Ex: Location: Asia, Country: India, State: Andhra Pradesh, City: Hyderabad. If i select any option in the Location drop down...
3
by: jcassan | last post by:
Hello folks. I am new to these forums and have something, which has been stumping me for little while. I am using pspell to spellcheck a scrolling textbox (textarea) containing user input. I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.