473,791 Members | 2,711 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CSS Float left not working on dropdown menu bar

3 New Member
Hi

I am trying to make dropdown menus for my website and am puzzled as to why my float left, in my container div, is not working (it is going underneath). Here is the code for both files. i hope someone csn put me right and tell me what code to change


CSS FILE
Expand|Select|Wrap|Line Numbers
  1. @charset "utf-8";
  2.  
  3.  
  4. #navMenu {
  5.      margin:0;
  6.      padding:0;
  7.      width:30em;
  8. }
  9.  
  10.  
  11.  
  12. #navMenu ul {
  13.      margin:0;
  14.      padding:0;
  15.      line-height:30px;
  16.      clear:both;
  17. }
  18.  
  19.  
  20.  
  21. #navMenu li {
  22.      margin:0;
  23.      padding:0;
  24.      list-style:none;
  25.      float:right;
  26.      position:relative;
  27.      background:#999;
  28.      clear:both;
  29. }
  30.  
  31.  
  32.  
  33. #wrapper {
  34.      margin:1;
  35.      padding:1;
  36.      float:left;
  37.      position:relative;
  38.  
  39.  
  40. }
  41.  
  42.  
  43. #container   {
  44.  
  45. width:2200px;
  46.  
  47. }
  48.  
  49.  
  50. #navMenu ul li a {
  51.      text-align:center;
  52.      font-family:"Comic Sans MS", cursive;
  53.      text-decoration:none;
  54.      height:30px;
  55.      width:150px;
  56.      display:block;
  57.      color:#FFF;
  58.  
  59.      border:1px solid #FFF;
  60.      text-shadow:1px 1px 1px #000;
  61. }
  62.  
  63.  
  64.  
  65. #navMenu ul ul {
  66.      position:absolute;
  67.      visibility:hidden;
  68.      top:32px;
  69. }
  70.  
  71.  
  72.  
  73. #navMenu ul li:hover ul {
  74.       visibility:visible;
  75.  
  76.  
  77. }
  78.  
  79. /************************************/
  80.  
  81.  
  82.  
  83. #navMenu li:hover {
  84.       background:#09F;
  85.  
  86.  
  87. }
  88.  
  89.  
  90.  
  91.  
  92. #navMenu ul li:hover ul li a:hover {
  93.       background:#CCC;
  94.       color:#000;
  95.  
  96. }
  97.  
  98.  
  99.  
  100. #navMenu a:hover {
  101.       color:#000;
  102.  
  103.  
  104. }
  105.  
  106.  
  107. .clearFloat {
  108.       clear:both;
  109.       margin:0;
  110.       padding:0;
  111.  
  112. }
  113.  
  114.  
  115. #leftnav  {
  116. float:left;
  117. width:200px;
  118. height:400px;
  119. border-left:1px 


html document (located at http://www.koodayexpress.co.uk/css/dropdownmenu.html)
Expand|Select|Wrap|Line Numbers
  1.  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2.             "http://www.w3.org/TR/html4/loose.dtd">
  3.  
  4. <html>
  5. <head>
  6.  
  7. <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-5"> 
  8. <title> Kooday Express Team - Our Team</title>
  9. <link rel="stylesheet" type="text/css" href="dropdown.css">
  10. </head>
  11.  
  12. <body>
  13.  
  14.  
  15.  
  16.  
  17. <div id="navMenu">
  18.  
  19. <ul>
  20.  
  21.   <div id="leftnav">
  22.   <li><a href="/index.html">Home</a></li>
  23. <li> <a href="/about-kooday.html">About Kooday.com</a></li>
  24. <li> <a href="/about-koodayexpress.html">Kooday Express</a></li>
  25. <li> <a href="/our-team.html">Our Team </a></li>
  26. <li> <a href="/news-updates.html">News &amp; Updates</a></li>
  27. <li> <a href="/events.html">Events</a></li>
  28. <li> <a href="/resources--links.html">Resources &amp; Links</a></li>
  29. <li> <a href="/contact.html">Contact Us</a></li><br />
  30. </ul>
  31. </div>
  32.  
  33. <br><br>
  34.  
  35.  
  36. <div id="container">
  37. <h2  style=" text-align: left; "><span style="color: rgb(255, 204, 0);">Darren Laverick, Group Leader & Administrator</span><br /></h2>
  38. <span  style=" z-index: 10; float: left; position: relative; "><a><img src="/images/darrenlaverick-small.gif" style="margin-top: 5px; margin-bottom: 10px; margin-left: 0px; margin-right: 10px; border-width:1px;padding:3px;" alt="Picture" class="galleryImageBorder" /></a><div style="display: block; font-size: 90%; margin-top: -10px; margin-bottom: 10px; text-align: center;"></div></span>
  39. <div  class="paragraph" style=" text-align: left; display: block; "><span style="color: rgb(255, 204, 0);"><font size="3"><span style="font-weight: bold;"><br /><span style="font-style: italic;">Kooday Diamond  <img src="/images/diamond-small.jpg" <br /><br /></span>Skype ID: eboodcom    <br>   MSN: drrnlav68@hotmail.co.uk <br />
  40. </div>
  41.  
  42. <div id="wrapper">
  43. <div id="navMenu">
  44.  
  45.  
  46. <ul>
  47. <li><a href="#">Kooday Status</a>
  48. <ul>
  49. <li><a href="http://www.koodayexpress.co.uk/screenshots/30.12.10/kooday_diamond.gif">30th December 2010</a></li>
  50. <li><a href="http://www.koodayexpress.co.uk/screenshots/23.12.10/kooday_diamond.gif">23rd December 2010</a></li>
  51. <li><a href="http://www.koodayexpress.co.uk/screenshots/16.12.10/kooday_diamond.gif">16th December 2010</a></li>
  52. <li><a href="http://www.koodayexpress.co.uk/screenshots/9.12.10/kooday_diamond.gif">9th December 2010</a></li>
  53. <li><a href="http://www.koodayexpress.co.uk/screenshots/2.12.10/kooday_diamond.gif">2nd December 2010</a></li>
  54.  
  55.  
  56. </ul>  <!-- end inner UL -->
  57.  
  58.  
  59.  
  60.  
  61. <br class="clearFloat" />
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68. <ul>
  69. <li><a href="#">Kooday Payout</a>
  70. <ul>
  71. <li><a href="http://www.koodayexpress.co.uk/screenshots/30.12.10/kooday_payout.gif">30th December 2010</a></li>
  72. <li><a href="http://www.koodayexpress.co.uk/screenshots/23.12.10/kooday_payout.gif">23rd December 2010</a></li>
  73. <li><a href="http://www.koodayexpress.co.uk/screenshots/16.12.10/kooday_payout.gif">16th December 2010</a></li>
  74. <li><a href="http://www.koodayexpress.co.uk/screenshots/9.12.10/kooday_payout.gif">9th December 2010</a></li>
  75. <li><a href="http://www.koodayexpress.co.uk/screenshots/2.12.10/kooday_payout.gif">2nd December 2010</a></li>
  76.  
  77.  
  78. </ul>  <!-- end inner UL -->
  79.  
  80.  
  81.  
  82. </div>  <!-- end navMenu -->
  83. </div>  <!-- end wrapper div -->
  84. </div>  <!-- end container div -->
  85.  
  86.  
  87. <br><br><br><br><br><br>
  88. <div>
  89. <span style="font-style: italic;"></font></span><font size="2"><a href="http://www.kooday.com/refer.asp?ref=34683">Sign up here. Have Darren as your sponsor!</a></font><br />
  90. <a href="http://www.facebook.com/profile.php?id=100000479093956"><img src="/images/facebook-small.jpg" </a>    &nbsp;  &nbsp; &nbsp; &nbsp; &nbsp;  &nbsp;  <a href="http://www.yournight.com/eboodcom"><img src="/images/yournight-small.jpg" </a>
  91. </div>
  92.  
  93.  
  94.  
  95.  
  96. </body>
  97. </html>
  98.  
  99.  
thanks in advance
Jan 4 '11 #1
3 5400
Darren Laverick
3 New Member
thanks, i am new to this.

can you help at all?
Jan 4 '11 #2
JKing
1,206 Recognized Expert Top Contributor
The only float left I see is on the #leftNav and it is outside of the container and it appears on the leftside of the screen.

The html has many problems regarding the proper nesting and closing of elements.
Jan 4 '11 #3
Darren Laverick
3 New Member
Hi

The float left command is in the wrapper div.

Any suggestions on new code to use would be appreciated

Once sorted, I can implement changes onto my website.

Many Thanks
Darren
Jan 5 '11 #4

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

Similar topics

5
1593
by: michael | last post by:
How may the following script be modified to function with the list structure below it? In short: it is meant to apply a background style to groups of LI's and ULs depeding on the URL filename. <style> ..high {background-color: #99FFCC;} ..low {background-color: #33CC00;} </style>
0
1286
by: kinane3 | last post by:
Mostly I need to figure if I'm wasting my time or if there is a way to do what I am trying to do. I am an intermediate to CSS at best so please don't flame me, just trying to do my job here. I came across this article when I searched for a CSS solution to long winded DHTML dropdown menus. http://www.alistapart.com/articles/dropdowns/ I did get it to work but here's my problem. What I "did" get to work was a horizontal drop in a...
1
6618
by: camphor | last post by:
hi, I have a single column webpage with a horizontal dropdown menu and am trying to make the nav bar fit across the page, the column is 800px, it looks ok in dreamweaver 8 but when I test it in firefox, the nav bar which is a horizontal blue stripe with the links written inside it doesn't stretch the whole 800px, also how would you align the words in the submenu to the main menu, currently the submenus are centered html <body> <div...
6
2339
by: adz1809 | last post by:
I have created this horizontal dropdown menu in css which is working fine in IE6+ but isn't firefox, and I have no idea why. here is the code: HTML: <body id="our-travels" class="home"> <div id="header"> <h1>Header</h1>
1
2331
by: awreese | last post by:
I've created a series of dropdown menus that work fine in Firefox, Safari, Camino, etc. but will not work at all in Windows IE. I'm presenting the whole file here hoping someone will come up with an answer. I've worked on this for days. Help will be appreciated. The website is: www.457thbombgroup.org/indexRR.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN"> <html>
19
3695
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 code for this from a tutorial but that menu was flush-left justified. Not what I want. Subsequent searches on google on how to center yielded a
0
2945
by: drowe | last post by:
I have changed my menus to be pure CSS and works fine in all browsers except Safari. The menus display but the second level drop downs dont work. The CSS is: /* CSS for top level bar menu */ div#sitenav { background-image: url('background_light.gif'); } div#sitenav li:hover ul { display: block;
3
7383
by: tceramesh | last post by:
Hi Friends, I Created one drop down menu by using CSS. It is perfect in Firefox but in IE it creates some problem. in the header section the drop down menu appear,, below that i used one table to put one list menu box.. The problem is, when we mouse over the drop down menu , list box appears in front of the drop down area.. how can i tackle this . The Error occurs only in IE not in Firefox. Here the Code : For...
2
3751
by: neovantage | last post by:
Hey all, I have integrated UL, Li base dropdown menu but it is bevaing abnormal in IE. Can somebody have a look on my code and help me out to fix the problem. Here is the Link of my website. *Note: It is working fine in Safari and Firefox Mozilla but creating problem in IE And here is the HTML code. <span class="preload1"></span> <span class="preload2"></span>
0
9669
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9515
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10207
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10154
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4109
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3713
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2913
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.