473,386 Members | 1,819 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.

CSS Menu Positioning

Hello,
I have a CSS Horizontal dropdown menu and the drop down menu is pushed to the right instead of directly underneath the heading. I am completely new to CSS and I do not yet know exactly what I am looking at in the CSS file. Any idea on how I can get it positioned correctly?
Coding as follows:

CSS style sheet:
--------------------------------------------------------
Expand|Select|Wrap|Line Numbers
  1. /* Begin CSS Drop Down Menu */ 
  2.  
  3. #menu { 
  4. width: 100%; 
  5. background: #eee; 
  6. float: left; 
  7. #menu ul { 
  8. list-style: none; 
  9. margin: 0; 
  10. padding: 0; 
  11. width: 12em; 
  12. float: left; 
  13.  
  14. #menu a, #menu h2 { 
  15. font: bold 11px/16px arial, helvetica, sans-serif; 
  16. display: block; 
  17. border-width: 1px; 
  18. border-style: solid; 
  19. border-color: #ccc #888 #555 #bbb; 
  20. margin: 0; 
  21. padding: 2px 3px; 
  22.  
  23. #menu h2 { 
  24. color: #fff; 
  25. background: #000; 
  26. text-transform: uppercase; 
  27.  
  28. #menu a { 
  29. color: #000; 
  30. background: #efefef; 
  31. text-decoration: none; 
  32.  
  33. #menu a:hover { 
  34. color: #a00; 
  35. background: #fff; 
  36.  
  37. #menu li {position: relative;} 
  38.  
  39. #menu ul ul { 
  40. position: absolute; 
  41. z-index: 500; 
  42.  
  43. #menu ul ul ul { 
  44. top: 0; 
  45. left: 100%; 
  46.  
  47. div#menu ul ul, 
  48. div#menu ul li:hover ul ul, 
  49. div#menu ul ul li:hover ul ul 
  50. {display: none;} 
  51.  
  52. div#menu ul li:hover ul, 
  53. div#menu ul ul li:hover ul, 
  54. div#menu ul ul ul li:hover ul 
  55. {display: block;} 
  56.  
  57. <!--[if IE]> 
  58. <style type="text/css" media="screen"> 
  59. body { 
  60. behavior: url(csshover.htc); 
  61. font-size: 100%; 
  62.  
  63. #menu ul li {float: left; width: 100%;} 
  64. #menu ul li a {height: 1%;} 
  65.  
  66. #menu a, #menu h2 { 
  67. font: bold 0.7em/1.4em arial, helvetica, sans-serif; 
  68. </style> 
  69. <![endif]--> 
--------------------------------------------------------

HTML as follows (sorry...I know it's long but I to make sure I get it right in the end):
-----------------------------------------------

Expand|Select|Wrap|Line Numbers
  1. <div id="menuhcontainer"> 
  2. <div id="menu"> 
  3. <ul style="width: 15%"> 
  4. <li><a href="http://www.site.com/bathroomfans/" class="topparent">Ventilation</a> 
  5. <ul> 
  6. <li><a title="Bathroom Fans" href="http://www.site.com/bathroomfans/" class="parent">Bathroom Fans</a> 
  7. <ul> 
  8. <li id="child"><a title="Ceiling Mounted Bathroom Fans" href="http://www.site.com/bathroomfans/102/" class="child">Ceiling Mounted</a></li> 
  9. <li><a title="Fans with Lights" href="http://www.site.com/bathroomfans/181/" class="child">Fans with Lights</a></li> 
  10. <li><a title="Fans with Heaters" href="http://www.site.com/bathroomfans/182/" class="child">Fans with Heaters</a></li> 
  11. <li><a title="Decorative Fans" href="http://www.site.com/bathroomfans/183/" class="child">Decorative Fans</a></li> 
  12. <li><a title="Humidity Sensor Fans" href="http://www.site.com/bathroomfans/184/" class="child">Humidity Sensor Fans</a></li> 
  13. <li><a title="Recessed Fans" href="http://www.site.com/bathroomfans/185/" class="child">Recessed Fans</a></li> 
  14. <li><a title="Remote Inlins Fans" href="http://www.site.com/bathroomfans/186/" class="child">Remote Inline Fans</a></li> 
  15. <li><a title="Wall Mounted Fans" href="http://www.site.com/bathroomfans/187/" class="child">Wall Mounted Fans</a></li> 
  16. <li><a title="Exterior Mounted Fans" href="http://www.site.com/bathroomfans/188/" class="child">Exterior Mounted Fans</a></li> 
  17. <li><a title="Passive Inlet Fans" href="http://www.site.com/bathroomfans/190/" class="child">Passive Inlet Fans</a></li> 
  18. <li><a title="Timers and Controls" href="http://www.site.com/bathroomfans/192/" class="child">Timers & Controls</a></li> 
  19. <li><a title="In-Shower Fans" href="http://www.site.com/bathroomfans/193/" class="child">In-Shower Fans</a></li> 
  20. <li><a title="Ductless Fans" href="http://www.site.com/bathroomfans/194/" class="child">Ductless Fans</a></li> 
  21. <li><a title="Fire-Rated Fans" href="http://www.site.com/bathroomfans/195/" class="child">Fire-rated Fans</a></li> 
  22. <li><a title="Energy Star® Fans" href="http://www.site.com/bathroomfans/548/" class="child">Energy Star® Fans</a></li> 
  23. <li><a title="Motion Sensor Fans" href="http://www.site.com/bathroomfans/661/" class="child">Motion Sensor Fans</a></li> 
  24. <li><a title="Eco-Friendly Fans" href="http://www.site.com/bathroomfans/211/" class="child">Eco-Friendly Fans</a></li> 
  25. </ul> 
  26. </li> 
  27. <li><a title="Range Hoods" href="http://www.site.com/rangehoods/" class="parent">Range Hoods</a> 
  28. <ul> 
  29. <li><a title="Wall Chimney Range Hoods" href="http://www.site.com/rangehoods/100/" class="child">Wall Chimney Range Hoods</a></li> 
  30. <li><a title="Island Range Hoods" href="http://www.site.com/rangehoods/103/" class="child">Island Range Hoods</a></li> 
  31. <li><a title="Under Cabinet Range Hoods" href="http://www.site.com/rangehoods/104/" class="child">Under Cabinet Range Hoods</a></li> 
  32. <li><a title="Ductless Range Hoods" href="http://www.site.com/rangehoods/105/" class="child">Ductless Range Hoods</a></li> 
  33. <li><a title="Ventilator Power Packs" href="http://www.site.com/rangehoods/106/" class="child">Ventilator Power Packs</a></li> 
  34. <li><a title="Outdoor Range Hoods" href="http://www.site.com/rangehoods/107/" class="child">Outdoor Range Hoods</a></li> 
  35. <li><a title="Wood Hoods" href="http://www.site.com/rangehoods/108/" class="child">Wood Hoods</a></li> 
  36. </ul> 
  37. </li> 
  38. <li><a title="Whole House Fans" href="http://www.site.com/wholehousefans/" class="parent">Whole House Fans</a> 
  39. <ul> 
  40. <li><a title="CVS Inline Fans" href="http://www.site.com/wholehousefans/645/" class="child">CVS Inline Fans</a></li> 
  41. <li><a title="Heat Recovery Systems" href="http://www.site.com/wholehousefans/646/" class="child">Heat Recovery Systems</a></li> 
  42. <li><a title="HEPA Filtration Units" href="http://www.site.com/wholehousefans/647/" class="child">HEPA Filtration Units</a></li> 
  43. <li><a title="Air Exchangers" href="http://www.site.com/wholehousefans/648/" class="child">Air Exchangers</a></li> 
  44. <li><a title="Energy Recovery Systems" href="http://www.site.com/wholehousefans/649/" class="child">Energy Recovery Systems</a></li> 
  45. <li><a title="Attic Fans" href="http://www.site.com/wholehousefans/650/" class="child">Attic Fans</a></li> 
  46. <li><a title="Accessories" href="http://www.site.com/wholehousefans/651/" class="child">Accessories</a></li> 
  47. </ul> 
  48. </li> 
  49. <li><a title="Dryer Booseter Fans" href="http://www.site.com/dryerboosterfans/" class="parent">Dryer Booster Fans</a> 
  50. <ul> 
  51. <li><a title="Dryer Booster Fans" href="http://www.site.com/dryerboosterfans/" class="child">Dryer Booster Fans</a></li> 
  52. <li><a title="Dryer Booster Fan Accessories" href="http://www.site.com/dryerboosterfans/643/" class="child">Accessories</a></li> 
  53. </ul> 
  54. </li> 
  55. <li><a title="Utility Fans" href="http://www.site.com/utilityfans/" class="parent">Utility Fans</a> 
  56. <ul> 
  57. <li><a title="Wall Mounted Utility Fans" href="http://www.site.com/utilityfans/638/" class="child">Wall Mounted Utility Fans</a></li> 
  58. <li><a title="Inline Utility Fans" href="http://www.site.com/utilityfans/639/" class="child">Inline Utility Fans</a></li> 
  59. <li><a title="Utility Fan Accessories" href="http://www.site.com/utilityfans/640/" class="child">Utility Fans Accessories</a></li> 
  60. </ul> 
  61. </li> 
  62. </ul></li> 
  63. </ul> 
  64. <ul style="width: 15%"> 
  65. <li><a title="fans" href="http://www.site.com/aircirculation/" class="topparent">Fans</a> 
  66. <ul> 
  67. <li><a title="Bathroom Fans" href="http://www.site.com/bathroomfans/" class="parent">Bathroom Fans</a> 
  68. <ul> 
  69. <li id="child"><a title="Ceiling Mounted Bathroom Fans" href="http://www.site.com/bathroomfans/102/" class="child">Ceiling Mounted</a></li> 
  70. <li><a title="Fans with Lights" href="http://www.site.com/bathroomfans/181/" class="child">Fans with Lights</a></li> 
  71. <li><a title="Fans with Heaters" href="http://www.site.com/bathroomfans/182/" class="child">Fans with Heaters</a></li> 
  72. <li><a title="Decorative Fans" href="http://www.site.com/bathroomfans/183/" class="child">Decorative Fans</a></li> 
  73. <li><a title="Humidity Sensor Fans" href="http://www.site.com/bathroomfans/184/" class="child">Humidity Sensor Fans</a></li> 
  74. <li><a title="Recessed Fans" href="http://www.site.com/bathroomfans/185/" class="child">Recessed Fans</a></li> 
  75. <li><a title="Remote Inlins Fans" href="http://www.site.com/bathroomfans/186/" class="child">Remote Inline Fans</a></li> 
  76. <li><a title="Wall Mounted Fans" href="http://www.site.com/bathroomfans/187/" class="child">Wall Mounted Fans</a></li> 
  77. <li><a title="Exterior Mounted Fans" href="http://www.site.com/bathroomfans/188/" class="child">Exterior Mounted Fans</a></li> 
  78. <li><a title="Passive Inlet Fans" href="http://www.site.com/bathroomfans/190/" class="child">Passive Inlet Fans</a></li> 
  79. <li><a title="Timers and Controls" href="http://www.site.com/bathroomfans/192/" class="child">Timers & Controls</a></li> 
  80. <li><a title="In-Shower Fans" href="http://www.site.com/bathroomfans/193/" class="child">In-Shower Fans</a></li> 
  81. <li><a title="Ductless Fans" href="http://www.site.com/bathroomfans/194/" class="child">Ductless Fans</a></li> 
  82. <li><a title="Fire-Rated Fans" href="http://www.site.com/bathroomfans/195/" class="child">Fire-rated Fans</a></li> 
  83. <li><a title="Energy Star® Fans" href="http://www.site.com/bathroomfans/548/" class="child">Energy Star® Fans</a></li> 
  84. <li><a title="Motion Sensor Fans" href="http://www.site.com/bathroomfans/661/" class="child">Motion Sensor Fans</a></li> 
  85. <li><a title="Eco-Friendly Fans" href="http://www.site.com/bathroomfans/211/" class="child">Eco-Friendly Fans</a></li> 
  86. </ul> 
  87. </li> 
  88. <li><a title="celing Fans" href="http://www.site.com/aircirculation/627/" class="parent">Ceiling Fans</a> 
  89. </li> 
  90. <li><a title="Floor Fans" href="http://www.site.com/aircirculation/628/" class="parent">Floor Fans</a> 
  91. </li> 
  92. <li><a title="Table Fans" href="http://www.site.com/aircirculation/629/" class="parent">Table Fans</a> 
  93. </li> 
  94. <li><a title="Outdoor Fans" href="http://www.site.com/aircirculation/630/" class="child">Outdoor Fans</a></li> 
  95. <li><a title="Fan Accessories" href="http://www.site.com/aircirculation/652/" class="child">Accessories</a></li> 
  96.  
  97. <li><a title="Utility Fans" href="http://www.site.com/utilityfans/" class="parent">Utility Fans</a> 
  98. <ul> 
  99. <li><a title="Wall Mounted Utility Fans" href="http://www.site.com/utilityfans/638/" class="child">Wall Mounted Utility Fans</a></li> 
  100. <li><a title="Inline Utility Fans" href="http://www.site.com/utilityfans/639/" class="child">Inline Utility Fans</a></li> 
  101. <li><a title="Utility Fan Accessories" href="http://www.site.com/utilityfans/640/" class="child">Utility Fans Accessories</a></li> 
  102. </ul> 
  103. <li><a title="Whole House Fans" href="http://www.site.com/wholehousefans/" class="parent">Whole House Fans</a> 
  104. <ul> 
  105. <li><a title="CVS Inline Fans" href="http://www.site.com/wholehousefans/645/" class="child">CVS Inline Fans</a></li> 
  106. <li><a title="Heat Recovery Systems" href="http://www.site.com/wholehousefans/646/" class="child">Heat Recovery Systems</a></li> 
  107. <li><a title="HEPA Filtration Units" href="http://www.site.com/wholehousefans/647/" class="child">HEPA Filtration Units</a></li> 
  108. <li><a title="Air Exchangers" href="http://www.site.com/wholehousefans/648/" class="child">Air Exchangers</a></li> 
  109. <li><a title="Energy Recovery Systems" href="http://www.site.com/wholehousefans/649/" class="child">Energy Recovery Systems</a></li> 
  110. <li><a title="Attic Fans" href="http://www.site.com/wholehousefans/650/" class="child">Attic Fans</a></li> 
  111. <li><a title="Accessories" href="http://www.site.com/wholehousefans/651/" class="child">Accessories</a></li> 
  112. </ul> 
  113. </li> 
  114. </ul> 
  115. </li> 
  116. </ul><ul style="width: 19%"> 
  117. <li><a title="Air Purifiers" href="http://www.site.com/airpurifiers/" class="topparent">Air Purifiers</a> 
  118. <ul> 
  119. <li><a title="Portable Air Purifiers" href="http://www.site.com/airpurifiers/607/" class="parent">Portable Air Purifiers</a></li> 
  120. <li><a title="Whole House Air Purifiers" href="http://www.site.com/airpurifiers/608/" class="parent">Whole House Air Purifiers</a></li> 
  121. <li><a title="Air Purifier Replacement Filters" href="http://www.site.com/airpurifiers/609/" class="parent">Replacement Filters</a></li> 
  122. </ul> 
  123. </li> 
  124. </ul><ul style="width: 30%"><li><a href="http://www.site.com/humidifiers/" class="topparent">Humidifiers & Dehumidifiers</a> 
  125. <ul> 
  126. <li><a title="Portable Humidifiers" href="http://www.site.com/humidifiers/622/" class="parent">Portable Humidifiers</a></li> 
  127. <li><a title="Room Humidifiers" href="http://www.site.com/humidifiers/623/" class="parent">Room Humidifiers</a></li> 
  128. <li><a title="Whole House Humidifiers" href="http://www.site.com/humidifiers/624/" class="parent">Whole House Humidifiers</a></li> 
  129. <li><a title="Energy Star Humidifiers" href="http://www.site.com/humidifiers/625/" class="parent">Energy Star Humidifiers</a></li> 
  130. <li><a title="Humidifier Accessories" href="http://www.site.com/humidifiers/654/" class="parent">Humidifier Accessories</a></li> 
  131. <li><a title="Portable Dehumidifiers" href="http://www.site.com/dehumidifiers/614/" class="parent">Portable Dehumidifiers</a></li> 
  132. <li><a title="Room Dehumidifiers" href="http://www.site.com/dehumidifiers/615/" class="parent">Room Dehumidifiers</a></li> 
  133. <li><a title="Basement Dehumidifiers" href="http://www.site.com/dehumidifiers/616/" class="parent">Basement Dehumidifiers</a></li> 
  134. <li><a title="Whole House Dehumidifiers" href="http://www.site.com/dehumidifiers/617/" class="parent">Whole House Dehumidifiers</a></li> 
  135. <li><a title="Crawl Space Dehumidifiers" href="http://www.site.com/dehumidifiers/618/" class="parent">Crawl Space Dehumidifiers</a></li> 
  136. <li><a title="Energy Star Dehumidifiers" href="http://www.site.com/dehumidifiers/619/" class="parent">Energy Star Dehumidifiers</a></li> 
  137. <li><a title="Dehimidifier Accessories" href="http://www.site.com/dehumidifiers/653/" class="parent">Dehumidifier Accessories</a></li> 
  138. </ul> 
  139. </li> 
  140. </ul><ul style="width: 20.5%"> 
  141. <li><a title="Vacuum Cleaners" href="http://www.site.com/vacuumcleaners/" class="topparent">Vacuum Cleaners</a> 
  142. <ul> 
  143. <li><a title="Central Vacuums" href="http://www.site.com/vacuumcleaners/632/" class="parent">Central Vacuums</a></li> 
  144. <li><a title="Canister Vacuum Cleaners" href="http://www.site.com/vacuumcleaners/633/" class="parent">Canister Vacuum Cleaners</a></li> 
  145. <li><a title="Upright Vacuum Cleaners" href="http://www.site.com/vacuumcleaners/634/" class="parent">Upright Vacuum Cleaners</a></li> 
  146. <li><a title="Handheld/Cordless Vacuums" href="http://www.site.com/vacuumcleaners/635/" class="parent">Handheld/Cordless Vacuums</a></li> 
  147. <li><a title="Vacuum Bags & Accessories" href="http://www.site.com/vacuumcleaners/636/" class="parent">Vacuum Bags & Accessories</a></li> 
  148. </ul> 
  149. </li> 
  150. </ul></div><!-- end the menuh-container div --> 
  151. </div><!-- end the menuh div --> 
-------------------------------------------------------------

Thank you so much in advance for your help!
Fiona
Oct 1 '08 #1
2 1388
Stang02GT
1,208 Expert 1GB
Please make sure in the future when you are posting code that you are using the [code] tags!
Oct 1 '08 #2
David Laakso
397 Expert 256MB
It is impossible know why it is to the right of the heading when the heading can't be seen.

Put the page in question on a public server and provide a clickable link to it in your post to the forum. Anyone can then view the markup and open the CSS file.
Oct 1 '08 #3

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

Similar topics

4
by: JesusFreak | last post by:
From: us_traveller@yahoo.com (JesusFreak) Newsgroups: microsoft.public.scripting.jscript Subject: toolbar script problem NNTP-Posting-Host: 192.92.126.136 Recently, I downloaded the following...
3
by: chubby | last post by:
I want a Fireworks popup menu to appear accross a frame boundary. Do I need to paste certain java script in all of the content html pages that appear in the main frame if the pop-up menu originates...
1
by: ajay | last post by:
I have following code for a slide menu but i twiked it to work for a single level menu. Open it in a Browser to get a clear picture. I have 2 Qs 1) How to make first entry as non-link. i.e i...
0
by: Jeroen Sangers | last post by:
Hello, I am having a problem in IE with my menu tabs. I want them to appear alligned on the bottom of my header, and therefore I have positioned my header relatively to set a positioning...
22
by: Marek Mand | last post by:
How to create a functional *flexible* UL-menu list <div> <ul> <li><a href=""></li> <li><a href=""></li> <li><a href=""></li> </ul> </div> (working in IE, Mozilla1.6, Opera7 (or maybe even...
5
by: toylet | last post by:
Attached is some css codes for a website. It has 3 parts: top-bar, side-bar (on the left) and main-body. The top-bar has a mouseover menu called top-menu implemented via ul:hover. When the mouse...
2
by: RWD | last post by:
I am trying to figure out how to change the target frame in my hyperlink on a DHTML menu. The menu is in one frame and the target frame is called "main" The code is below: Thanks in advance...
3
by: Ernst | last post by:
I have a script for a menu. However, this menu uses absolute coordinates. This menu had to be placed on a website. This website is position (centered) using a table. How can I determine/calculate...
1
by: Anthony | last post by:
Below is a script I found at http://javascript.internet.com/ for a cascading menu. The script works great but there is one thing that I would like modified. BecauseI am just learning javascript,...
1
by: worldwideebm | last post by:
This problem is hard to to explain. I have a web page with a container that has all of my content on it and then on the side of that container I have a small menu type of thing that I made which...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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.