Connecting Tech Pros Worldwide Forums | Help | Site Map

Question ab my CSS menu? STUCK!

Newbie
 
Join Date: Oct 2009
Posts: 1
#1: Oct 21 '09
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. }

Reply