473,387 Members | 1,569 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,387 software developers and data experts.

Question ab my CSS menu? STUCK!

I am trying to create a dropdown menu using ONLY css. I am having a problem. I need to get the headings a different color and font than the subheadings. I need the heading to be white and have a hover of black text and white background. I need my subheading to be black, font verdana, size 10 and have a hover of #ace1f1. Right now, everytime I change one, the other changes as well. The list and CSS sheet is below. Thanks for the help!!

Here is my list:

Expand|Select|Wrap|Line Numbers
  1. <ul class="dropdown">
  2.   <li><a href="about_new.htm" >About Us</a>
  3. <ul class="dropdown">
  4.       <li><a href="corpgov_new.htm">Corporate Governance</a></li>
  5.       <li><a href="strategy_new.htm">Our Strategy</a></li>
  6.       <li><a href="strengths_new.htm">Our Strengths</a></li>
  7.       <li><a href="history_new.htm">Our History</a></li>
  8.     </ul>
  9.   </li>
  10.   <li><a href="caution_new.htm" class="dropdown">Investor Relations</a></li>
  11.   <li><a href="site_new.htm">Site Map</a></li>
  12.   <li><a href="info_new.htm">Contact Us</a>
  13. <ul>
  14.       <li><a href="info_new.htm">Information Request</a></li>
  15.       <li><a href="add_new.htm">Add/Remove Me to E-mail List</a></li>
  16.       <li class="dropdown"><a href="career_new.htm">Career Opportunities</a></li>
  17.     </ul>
  18.   </li>
  19. </ul>


Here is my CSS sheet

Expand|Select|Wrap|Line Numbers
  1. ul.dropdown {
  2.     background-color: #006699;
  3.     float: none;
  4.     list-style-image: none;
  5.     list-style-type: none;
  6.     position: relative;
  7.     z-index: 597;
  8.     width: 826px;
  9.     vertical-align: middle;
  10.     word-spacing: normal;
  11.     visibility: visible;
  12.     color: #000;
  13.     font-family: Arial, Helvetica, sans-serif;
  14.     white-space: nowrap;
  15.     letter-spacing: normal;
  16.     text-indent: 0%;
  17.     font-size: 12px;
  18.     font-weight: bold;
  19.     padding: 0px;
  20.     margin-top: -7px;
  21.     margin-right: 0px;
  22.     margin-bottom: 0px;
  23.     margin-left: -207.75px;
  24.     page-break-before: auto;
  25.     page-break-after: auto;
  26. }
  27.  
  28. ul.dropdown a:link {
  29.     font-family: Arial, Helvetica, sans-serif;
  30.     color: #000;
  31.     text-decoration: none;
  32.     font-size: 12px;
  33.     font-style: normal;
  34.     text-align: left;
  35.     border-bottom-style: none;
  36.     border-top-style: none;
  37.     border-right-style: none;
  38.     border-left-style: none;
  39. }
  40. ul.dropdown li:hover {
  41.     background-color: #ace1f1;
  42.     position: relative;
  43.     z-index: 599;
  44.     color: #000;
  45.     font-family: Arial, Helvetica, sans-serif;
  46.     background-position: center;
  47. }
  48. ul.dropdown a:visited {
  49.     font-family: Arial, Helvetica, sans-serif;
  50.     color: #000;
  51.     text-decoration: none;
  52.     font-size: 12px;
  53.     font-style: normal;
  54.     text-align: left;
  55.     border-bottom-style: none;
  56. }
  57.  
  58.  
  59. ul.dropdown a:hover {
  60.     color: #FFF;
  61.     text-decoration: none;
  62.     display: block;
  63.     font-family: Arial, Helvetica, sans-serif;
  64.     background-color: #ace1f1;
  65.     visibility: visible;
  66. }
  67. ul.dropdown li {
  68.     line-height: 1.3em;
  69.     vertical-align: middle;
  70.     float: left;
  71.     padding-top: 7px;
  72.     padding-right: 69px;
  73.     padding-bottom: 7px;
  74.     padding-left: 69px;
  75.     border-right-width: 0px;
  76.     border-right-style: none;
  77.     border-right-color: #999999;
  78.     list-style-image: none;
  79.     list-style-type: none;
  80.     color: #FFF;
  81.     text-align: left;
  82.     margin: 0px;
  83.     font-size: 12px;
  84. }
  85.  
  86. ul.dropdown ul {
  87.     background-color: #EEEDED;
  88.     margin: 0px;
  89.     width: 206.5px;
  90.     list-style-image: none;
  91.     list-style-type: none;
  92.     position: absolute;
  93.     visibility: hidden;
  94.     z-index: 598;
  95.     left: 0%;
  96.     top: 100%;
  97.     float: left;
  98.     text-align: left;
  99.     padding-top: 0px;
  100.     padding-right: 10px;
  101.     padding-bottom: 0px;
  102.     padding-left: 10px;
  103.     font-family: Arial, Helvetica, sans-serif;
  104.     font-size: 12px;
  105.     color: #000;
  106. }
  107. ul.dropdown.li {
  108.     line-height: 1.3em;
  109.     vertical-align: middle;
  110.     margin: 0px;
  111.     float: left;
  112.     padding-top: 7px;
  113.     padding-right: 20px;
  114.     padding-bottom: 7px;
  115.     padding-left: 10px;
  116.     border-right-width: 1px;
  117.     border-right-style: solid;
  118.     border-right-color: #999999;
  119.     list-style-image: none;
  120.     list-style-type: none;
  121.     border-top-style: none;
  122.     border-bottom-style: none;
  123.     border-left-style: none;
  124.     text-align: right;
  125.     width: 300px;
  126.     font-family: Arial, Helvetica, sans-serif;
  127.     position: relative;
  128.     font-size: 14px;
  129.     color: #FFF;
  130. }
  131. ul dropdown li:hover {
  132.     background-color: #ace1f1;
  133.     position: relative;
  134.     z-index: 599;
  135. }
  136. ul.dropdown li:hover > ul {
  137.     visibility: visible;
  138.     background-color: #eeeded;
  139. }
  140. ul.dropdown ul li {
  141.     float: none;
  142.     border-top-style: none;
  143.     border-right-style: none;
  144.     border-bottom-style: solid;
  145.     border-left-style: none;
  146.     text-align: left;
  147.     border-bottom-width: 1px;
  148.     border-bottom-color: #ace1f1;
  149.     padding-right: 30px;
  150.     padding-left: 5px;
  151.     background-color: #eeeded;
  152.     font-family: Arial, Helvetica, sans-serif;
  153.     font-size: 12px;
  154.     color: #FFF;
  155. }
  156. ul.dropdown {
  157.     background-color: #006699;
  158.     float: left;
  159.     list-style-image: none;
  160.     list-style-type: none;
  161.     position: relative;
  162.     z-index: 597;
  163.     color: #FFF;
  164.     overflow: visible;
  165.     left: 25%;
  166.     top: 0px;
  167.     right: 25%;
  168.     bottom: 0px;
  169.     font-size: 12px;
  170.     background-image: none;
  171. }
Oct 21 '09 #1
0 1343

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

Similar topics

4
by: elad | last post by:
Hi I'm working with HV Menu 5.5 (downloaded from www.dynamicdrive.com ) I'm using it with 2 horizontal frames. The menu works great if the FirstLineFrame and SecLineFrame are the same (The...
13
by: elad | last post by:
Hi The Menu doesn't work properly when I have 2 frame and the Menu popup frame=document target frame, when I choose item in the menu the doc opened and the menu get stuck. Here is the code...
0
by: der kommissar | last post by:
Hi all I'm having a small problem with a navigation menu on a site i'm doing. The address of the site is: http://www.statik.be/radiomol/ All works perfectly fine in FireFox, Opera and...
0
by: Derrick | last post by:
I'm trying to calculate the height of a context menu in a manner that will work in both the full framework (where the calculation is easier because of the MeasureItem event of a MenuItem) and the...
7
by: zorhel | last post by:
Hi. I will do a dynamic menu for a asp.net app.. I don't know yet if how I will get the data for populate this menu: from a sql server database, xml file or what, but I know it will be dynamic any...
5
by: james | last post by:
Hello, I am having a little trouble creating an event handler for a context menu toolstripmenuitem. I've seen various tutorials and so on, but I keep getting a bit stuck! So far I have a second...
0
by: benfly08 | last post by:
Hi, I used SWT to develop an windows application. In the application there is a dynamic created popup menu. The dynamic part is that i will pass a list of name to be a submenu of one menu item....
6
by: deltamami0999 | last post by:
I just received this e-mail from a colleague of mine that got stuck and she sent it to me and i'm stuck....we're wondering what this is all about.....can anyone help? Inventory Management...
19
by: Jim | last post by:
Hi, I have two questions/problems pertaining to CSS horizontal dropdown menus and am hoping that someone here can help me out. (1) I'm having a problem centering the menu. I picked up the...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.