CSS - Drop Down Menu Positioning Issue
If you look at the main menu(Home-About MCAEC-The Academy-Adult Education-Shining Star-Giving) on this page and hover over one of the parent categories you'll see issues with the positioning of the dropdown. I adjusted the margin and it looks fine in IE but the dropdown floats over the parent tabs in Firefox and Opera. Is there a way to adjust this so it's consistent in all browsers?
Here's the code for the dropdown ul ul li a: Code: #dropmenu { z-index:100; position:relative;} #dropmenu .menu ul ul {z-index:99; margin:0; width:160px; background:url(images/bg_sub.png) top left no-repeat !important; margin: 10px 0px 0px 0px ; position: absolute; display:none; padding-bottom:10px !important; clear:both; padding-top:13px;} #dropmenu .menu ul ul li { line-height:inherit; height:auto; text-align:left; width:160px; text-align:left; line-height:1.69em;} #dropmenu .menu ul ul li a{ font-weight: normal; color:#fff; font-size:13px; text-transform:none; } #dropmenu .menu ul ul li a:hover { color:#edc951; font-weight:normal; } Thanks Similar TutorialsHello All, I have a left navigation bar that seems to be working perfectly in Firefox and Safari. However (I know, you've heard this before!), when I open the page in IE, there is no list appearing whatsoever. When I hover in a place outside of where the ul is supposed to be, I can find where the menu is, but it is not functioning well. Could someone please take a look and provide some insight? I have tried a few different things but they are mostly guesses as this is pushing my understanding of CSS a bit. The menu is supposed to appear under the "Select a Tool" text... 029c92a.netsolhost.com/brushes.html Best Regards, Colin My first question relates to my earlier problem which I fixed, excpet that the code that was messing it up was "img { border-width: 0; }" The problem w/ this is that I do not want any borders around my images, it makes the page look bad. Does anyone have a workaround? (Note that I also tried #menu a img { border-width....etc } ) For the second question:: I've noticed that my background positions fine in IE but the rest of the images won't move to where I positioned them. link to my page:: main link to css page:: css page Hi, I'm trying to make a drop-down menu using CSS and javascript. I'm posting this here because the javascript (and most of the css!) is working fine, I just need some help with the positioning. You can see the menu so far on the website I'm beginning to develop, 10pinleague.com. As you can see the initial drop downs work as intended but when you attempt to open a submenu, that should appear to the right of the drop down menu, it appears in completely the wrong place. And for some odd reason the distance from the drop-down menus to the submenus increases more and more as you progress from Menu 1 to Menu 2 and 3. I'm no expert at either javascript or CSS, so the drop down menu was something that I downloaded from a website, here, and then adapted to suit my site. Perhaps this wasn't intended to work as a cascading drop down menu. I just thought if I apply the same principle of wrapping the link in a div and getting that to show another new div containing the submenu it should work. And it kind of does, just in the wrong place - which I do not understand why this happens. Here is the HTML code for the menu. (note this is not the actual code on my website, this is code that is generated from a php loop I've made. But the HTML remains the same). Code: <!-- START OF MENU !--> <table width='730' height='30'> <tr> <td width='20%' align='center'> <div id='menu1a'> <a href='#'>Menu 1</a> </div> <div id='menu1b' class='menu_dropdown'> <table width='150' height='50'> <tr> <td class='padded'> <table width='100%' height='100%'> <tr> <td class='menuNormal' onmouseover='expand(this);' onmouseout='collapse(this);'> <div id='submenu1_1a'> <a href='#'>Item 1</a> </div> </td> </tr> <tr> <td class='menuNormal' onmouseover='expand(this);' onmouseout='collapse(this);'> <div id='submenu1_2a'> <a href='#'>Item 2</a> </div> </td> </tr> <tr> <td class='menuNormal' onmouseover='expand(this);' onmouseout='collapse(this);'> <div id='submenu1_3a'> <a href='#'>Item 3</a> </div> </td> </tr> </table> </td> </tr> </table> </div> <script type='text/javascript'>at_attach('menu1a', 'menu1b', 'hover', 'y', 'pointer');</script> </td> <td width='20%' align='center'><div id='menu2a'> <a href='#'>Menu 2</a> </div> <div id='menu2b' class='menu_dropdown'> <table width='150' height='50'> <tr> <td class='padded'> <table width='100%' height='100%'> <tr> <td class='menuNormal' onmouseover='expand(this);' onmouseout='collapse(this);'> <div id='submenu2_1a'> <a href='#'>Item 2</a> </div> </td> </tr> <tr> <td class='menuNormal' onmouseover='expand(this);' onmouseout='collapse(this);'> <div id='submenu2_2a'> <a href='#'>Item 2</a> </div> </td> </tr> <tr> <td class='menuNormal' onmouseover='expand(this);' onmouseout='collapse(this);'> <div id='submenu2_3a'> <a href='#'>Item 3</a> </div> </td> </tr> <tr> <td class='menuNormal' onmouseover='expand(this);' onmouseout='collapse(this);'> <div id='submenu2_4a'> <a href='#'>Item 4 ></a> </div> <div id='submenu2_4b' class='menu_dropdown'> <table width='150' height='50'> <tr> <td class='padded'> <table width='100%' height='100%'> <tr> <td class='menuNormal' onmouseover='expand(this);' onmouseout='collapse(this);'> <a href='#'>Item 4a</a> </td> </tr> <tr> <td class='menuNormal' onmouseover='expand(this);' onmouseout='collapse(this);'> <a href='#'>Item 4b</a> </td> </tr> </table> </td> </tr> </table> </div> <script type='text/javascript'>at_attach('submenu2_4a', 'submenu2_4b', 'hover', 'y', 'pointer');</script> </td> </tr> <tr> <td class='menuNormal' onmouseover='expand(this);' onmouseout='collapse(this);'> <div id='submenu2_5a'> <a href='#'>Item 5</a> </div> </td> </tr> </table> </td> </tr> </table> </div> <script type='text/javascript'>at_attach('menu2a', 'menu2b', 'hover', 'y', 'pointer');</script></td><td width='20%' align='center'><div id='menu3a'><a href='#'>Menu 3</a></div><div id='menu3b' class='menu_dropdown'><table width='150' height='50'><tr><td class='padded'><table width='100%' height='100%'><tr><td class='menuNormal' onmouseover='expand(this);' onmouseout='collapse(this);'><div id='submenu3_1a'><a href='#'>Item 3</a></div></td></tr><tr><td class='menuNormal' onmouseover='expand(this);' onmouseout='collapse(this);'><div id='submenu3_2a'><a href='#'>Item 2</a></div></td></tr><tr><td class='menuNormal' onmouseover='expand(this);' onmouseout='collapse(this);'><div id='submenu3_3a'><a href='#'>Item 3</a></div></td></tr></table></td></tr></table></div><script type='text/javascript'>at_attach('menu3a', 'menu3b', 'hover', 'y', 'pointer');</script></td><td width='20%' align='center'><div id='menu4a'><a href='#'>Menu 4</a></div><div id='menu4b' class='menu_dropdown'><table width='150' height='50'><tr><td class='padded'><table width='100%' height='100%'><tr><td class='menuNormal' onmouseover='expand(this);' onmouseout='collapse(this);'><div id='submenu4_1a'><a href='#'>Item 4</a></div></td></tr><tr><td class='menuNormal' onmouseover='expand(this);' onmouseout='collapse(this);'><div id='submenu4_2a'><a href='#'>Item 2</a></div></td></tr><tr><td class='menuNormal' onmouseover='expand(this);' onmouseout='collapse(this);'><div id='submenu4_3a'><a href='#'>Item 3</a></div></td></tr></table></td></tr></table></div><script type='text/javascript'>at_attach('menu4a', 'menu4b', 'hover', 'y', 'pointer');</script></td><td width='20%' align='center'><div id='menu5a'><a href='#'>Menu 5</a></div><div id='menu5b' class='menu_dropdown'><table width='150' height='50'><tr><td class='padded'><table width='100%' height='100%'><tr><td class='menuNormal' onmouseover='expand(this);' onmouseout='collapse(this);'><div id='submenu5_1a'><a href='#'>Item 1</a></div></td></tr><tr><td class='menuNormal' onmouseover='expand(this);' onmouseout='collapse(this);'><div id='submenu5_2a'><a href='#'>Item 2</a></div></td></tr><tr><td class='menuNormal' onmouseover='expand(this);' onmouseout='collapse(this);'><div id='submenu5_3a'><a href='#'>Item 3</a></div></td></tr></table></td></tr></table></div><script type='text/javascript'>at_attach('menu5a', 'menu5b', 'hover', 'y', 'pointer');</script></td> </tr> </table> Here is the related CSS.....but I doubt this is important. Code: .menu_dropdown { background-color: #a5caad; border: 1px solid #057c1f; position: absolute; visibility: hidden; font-size: small; } .menu_dropdown A:link {text-decoration: none; color: #000; font-weight: normal; } .menu_dropdown A:visited {text-decoration: none; color: #000; font-weight: normal; } .menu_dropdown A:active {text-decoration: none; color: #000; font-weight: normal; } .menu_dropdown A:hover {text-decoration: underline; color: #000; font-weight: normal; } td.menuNormal {padding: 0px; font-weight: bold; vertical-align: top; background-color:#a5caad;} td.menuHover {padding: 0px; font-weight: bold; vertical-align: top; background-color: #87bc93;} And here is the javascript file, that I have not modified in any way from the site I linked to above. Code: // <script> // Copyright (C) 2005 Ilya S. Lyubinskiy. All rights reserved. // Technical support: http://www.php-development.ru/ // // YOU MAY NOT // (1) Remove or modify this copyright notice. // (2) Distribute this code, any part or any modified version of it. // Instead, you can link to the homepage of this code: // http://www.php-development.ru/javascripts/dropdown.php. // // YOU MAY // (1) Use this code on your website. // (2) Use this code as a part of another product provided that // its main use is not creating javascript menus. // // NO WARRANTY // This code is provided "as is" without warranty of any kind, either // expressed or implied, including, but not limited to, the implied warranties // of merchantability and fitness for a particular purpose. You expressly // acknowledge and agree that use of this code is at your own risk. function expand(s) { var td = s; var d = td.getElementsByTagName("div").item(0); td.className = "menuHover"; } function collapse(s) { var td = s; var d = td.getElementsByTagName("div").item(0); td.className = "menuNormal"; } // ----- Popup Control --------------------------------------------------------- function at_display(x) { var win = window.open(); for (var i in x) win.document.write(i+' = '+x[i]+'<br>'); } // ----- Show Aux ----- function at_show_aux(parent, child) { var p = document.getElementById(parent); var c = document.getElementById(child ); var top = (c["at_position"] == "y") ? p.offsetHeight+2 : 0; var left = (c["at_position"] == "x") ? p.offsetWidth +2 : 0; for (; p; p = p.offsetParent) { top += p.offsetTop; left += p.offsetLeft; } c.style.position = "absolute"; c.style.top = top +'px'; c.style.left = left+'px'; c.style.visibility = "visible"; } // ----- Show ----- function at_show() { var p = document.getElementById(this["at_parent"]); var c = document.getElementById(this["at_child" ]); at_show_aux(p.id, c.id); clearTimeout(c["at_timeout"]); } // ----- Hide ----- function at_hide() { var c = document.getElementById(this["at_child"]); c["at_timeout"] = setTimeout("document.getElementById('"+c.id+"').style.visibility = 'hidden'", 333); } // ----- Click ----- function at_click() { var p = document.getElementById(this["at_parent"]); var c = document.getElementById(this["at_child" ]); if (c.style.visibility != "visible") at_show_aux(p.id, c.id); else c.style.visibility = "hidden"; return false; } // ----- Attach ----- // PARAMETERS: // parent - id of visible html element // child - id of invisible html element that will be dropdowned // showtype - "click" = you should click the parent to show/hide the child // "hover" = you should place the mouse over the parent to show // the child // position - "x" = the child is displayed to the right of the parent // "y" = the child is displayed below the parent // cursor - Omit to use default cursor or check any CSS manual for possible // values of this field function at_attach(parent, child, showtype, position, cursor) { var p = document.getElementById(parent); var c = document.getElementById(child); p["at_parent"] = p.id; c["at_parent"] = p.id; p["at_child"] = c.id; c["at_child"] = c.id; p["at_position"] = position; c["at_position"] = position; c.style.position = "absolute"; c.style.visibility = "hidden"; if (cursor != undefined) p.style.cursor = cursor; switch (showtype) { case "click": p.onclick = at_click; p.onmouseout = at_hide; c.onmouseover = at_show; c.onmouseout = at_hide; break; case "hover": p.onmouseover = at_show; p.onmouseout = at_hide; c.onmouseover = at_show; c.onmouseout = at_hide; break; } } Can somebody please help me get the submenus appearing next to the divs in the drop-down menus that they relate to, rather than half way across the page? Thank you very much! PS. If you think I've asked this in the wrong place and it should be in the Javascript forum, could you move it for me? Thanks. Hi all! I'm trying to make a horizontal menu with vertical drop downs.. However, the dropdowns don't go where they're supposed to. The menu is more or less at hybrid between a horizontal menu and a drop-down menu, so it's probably all more or less messed up You can check out the site at: cleopatra.gebodesign.no The files are at: gebodesign.no/cleopatra/menu.php gebodesign.no/cleopatra/stylesheet.css Thanks for any input Hello, I'm building a portfolio for a close friend of mine and I REALLY can't seem to figure out this navigation menu she wants me to make. I have the menu in place but the drop down is both WAY too far to the right and UNDER the slideshow. Could anyone kindly show me how to get that stupid thing to appear UNDER the 'Galleries' section and ABOVE the slideshow? http://saranicolephotography.com/ Thanks! http://www.freewebs.com/dmorand/NMI%20Web.htm That's what I've done so far, but the drop-down menu isn't displaying in IE, but it does in Firefox. Anyone have any ideas? Also, in Firefox I see a couple of dashes in the top left corner, that I don't see in IE. Can somebody please look at the following drop-down menu and tell me why it breaks in IE...it works fine in Mozilla/FF... In IE, the problem is that the sub-menus do not completely appear in front of their parent menus...they should be on top of their parent menus...like i said, it works in FF, so you can switch bewteen browsers to see the difference.... Thanks for any help. __________________ R.J. www.mediamogulsweb.com Ok, I'm using wordpress theme SLR Lounge V2, and am trying to modify it to suit my needs. The problem I'm having is with my navigation's drop down menu. I'm currently using a custom menu (wordpress functionality, not theme). Initially, there was no background behind the drop down at all (so you couldn't really read it), which I've managed to modify to get the colour I want, however, I don't want the gaps, and I want it all to line up flush on the right hand side. Here's a screenshot of what I'm talking about: http://i.imgur.com/uSn1i.jpg I've played with padding etc to no avail. Also, sometimes the navigation elements end up paired beside each other instead of a straight vertical list if I play with the padding. Here is the css I have relating to the drop down navigation: Code: /* Start Menu Items */ #menu { list-style:none; margin:0; padding:0; width:1000px; height:100%; border:none; } #menu:after { content:''; display:block; clear:both; } #menu li.hover a,#menu li:hover a,#menu li.hover,#menu li:hover { position: relative; } #menu li.hover ul, #menu li:hover ul { display: block; } /*start drop-down menus on the top menu*/ #menu ul { padding:0; margin:0 0 0 -10px; list-style:none; width:108px; display: none; /*******if you delete this, your drop down menu will appear randomly on the page somewhere **/ position: absolute; } #menu ul li a { /*This is the drop down stufff */ text-align:left; float:right; I have a drop down menu that is working fine in FF 3.5 but not in IE 7. Will you please have a look at it and help me find out where the conflict is? I am thinking it is a CSS issue but it may also be a javascript issue. The menu is he http://bit.ly/42iVkG and the menu script I used is he http://bit.ly/4pvcXj Thank you. Hi everyone, I am having an issue with IE7 (imagine that) with a css drop down nav menu. On IE8 and Chrome the menus work flawlessly but in on IE7 the menu is behind the pictures on the page. The page is located at www.philadler.com/newlayout2.php. At first I thought it may be a z-index problem but the nav bar is set to 1000 and 900 depending on the menu and the thumbnails are set to 100. As of now the site validates on both css and xhtml 1.0 transitional. I can list any code if needed. Thanks for any help Phil Hello everyone, I have a drop-down menu that is currently working well. The only change I need to make is to have the right edge of the drop-down menu to align with the right edge of the parent menu. When you hover over the menu, it currently "drops" down and to the right, with the left edges aligned. I want the menu to "drop" down and to the left, so the right edges are aligned. I have tried fiddling with floats and absolute/relative positioning. I'm not sure what needs to be changed. Any help you can provide is greatly appreciated! I'm learning via "cut and paste", so please go easy on any terminology you may use. Thank you! Here is the page: http://www.littlebuddymedia.com/site05/012.html The menu currently drops like this (aligned along the left edge): http://www.justskins.com/wp-content/uploads/2008/12/drop-down-menu.gif I want the menu to do this (align along the right edge; see how "Artists" is aligned under "Music" along the right edge): http://artatm.com/wp-content/uploads/2009/11/mtvmenu.JPG Here is my code: Code: .chromestyle{ width: 100%; font-weight: bold; float: left; height: 29px; } .chromestyle:after{ /*Add margin between menu and rest of content in Firefox*/ content: "."; display: block; height: 0; clear: both; visibility: hidden; } .chromestyle ul{ border: 0px solid #BBB; width: 100%; background: url(chromebg.gif) center center repeat-x; /*THEME CHANGE HERE*/ padding: 4px 0; margin: 0; text-align: right; /*set value to "left", "center", or "right"*/ } .chromestyle ul li{ display: inline; } .chromestyle ul li a{ color: #000000; padding: 4px 7px; margin: 0; text-decoration: none; border-left: 1px solid #DADADA; } .chromestyle ul li a:hover, .chromestyle ul li a.selected{ /*script dynamically adds a class of "selected" to the current active menu item*/ background: url(chromebg-over.gif) center center repeat-x; /*THEME CHANGE HERE*/ } /* ######### Style for Drop Down Menu ######### */ .dropmenudiv{ position:absolute; top: 0; border: 1px solid #BBB; /*THEME CHANGE HERE*/ border-bottom-width: 0; font:normal 12px Verdana; line-height:18px; z-index:100; background-color: white; width: 200px; visibility: hidden; } .dropmenudiv a{ width: auto; display: block; text-indent: 3px; border-bottom: 1px solid #BBB; /*THEME CHANGE HERE*/ padding: 2px 5px; text-decoration: none; font-weight: bold; color: black; } * html .dropmenudiv a{ /*IE only hack*/ width: 100%; } .dropmenudiv a:hover{ /*THEME CHANGE HERE*/ background-color: #0000ff; color: #fff200; } Following sample is from http://www.code-couch.com/jeff/snippets/general/tektips-navigation-example.html is what I am trying to reference to create a template. But how do I how keep the state of Menu on each requested page any help is appreciated. The following menu is saved in a separate jsp file i.e. navs.jsp. I include this navigation jsp file in all of my files. Initially the drop down looks like: Code: . Ask.Jeeves . [+] Google.com . [+] Yahoo.com Now clicking [+] in front of Google.com will look like. Code: . Ask.Jeeves . [-] Google.com . Google.co.ie . Google.co.ie . [+] Google.co.nz . [+] Yahoo.com Lets's say now if I click on Google.co.ie it takes me to sample.jsp and on this requested page (sample.jsp) how can I show the following menu hierarchy with Google.co.ie bold/underlined/colorchanged showing what menu content I clicked and am viewing the appropriate content i.e. Code: . Ask.Jeeves . [-] Google.com . Google.co.ie . Google.co.ie . [+] Google.co.nz . [+] Yahoo.com Same way clicking Google.com or Yahoo.com or Ask.Jeeves shows you the following hierarchy on the requested page with higlight/bold/colored the link we just selected. i.e. Code: . Ask.Jeeves . [+] Google.com . [+] Yahoo.com Any time clicking on the menu takes me to some page but on that page I want to show th hierarchy of the menu all the way to which is recently clicked with different color setting. Here is the source for the above: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/> <meta http-equiv="content-language" content="en"/> <title>Test Harness</title> <style type="text/css"> ul li ul {display:none;list-style-type: none;} #myNav li a:hover { color: blue; } #myNav li a:active { color: #FF0000; background: #FFFFFF; } #myNav { list-style-image: url(page.GIF); } </style> <script type="text/javascript"> <!-- function initNav() { var navObj = document.getElementById('myNav'); var ulCollection = navObj.getElementsByTagName('li'); for (var loop = 0; loop < ulCollection.length; loop++) { if(ulCollection[loop].getElementsByTagName('ul').length > 0) { /* we have an LI that contains a UL */ if (ulCollection[loop].getElementsByTagName('span').length > 0) { /* there is at least one SPAN tag present */ ulCollection[loop].getElementsByTagName('span')[0].innerHTML = "[<a href=\"javascript://\" onclick=\"this.innerHTML=this.innerHTML=='+'?'-':'+';temp=this.parentNode.parentNode.getElementsByTagName('ul')[0].style;temp.display=temp.display=='block'?'none':'block';\">+</a>] "; } } } } window.onload = initNav; //--> </script> </head> <body> <ul id="myNav"> <li><a href="http://www.askjeeves.com">Ask.Jeeves</a></li> <li><span></span><a href="http://www.google.com">Google.com</a> <ul> <li><a href="http://www.google.co.uk">Google.co.uk</a></li> <li><a href="http://www.google.co.ie">Google.co.ie</a></li> <li><span></span><a href="http://www.google.co.nz">Google.co.nz</a> <ul> <li>*3*</li> <li>*4*</li> </ul> </li> </ul> </li> <li><span></span><a href="http://www.yahoo.com">Yahoo.com</a> <ul> <li><a href="http://www.yahoo.co.uk">Yahoo.co.uk</a></li> <li><a href="http://www.yahoo.co.nz">Yahoo.co.nz</a></li> </ul> </li> </ul> </body> </html> Any help is really appreciated thanks. EDIT:: Simplier way to write the question ^.^ :: When I scroll off the menu/link onto the first link in the submenu it stays, but when I mvoe down to the next item in the submenu it disappears. (My drop down is vertically aligned on the left.) (bits of the code that relate to the menu) PHP Code: .btn1 { position: absolute; left: 165px; top: 200px; } .btn2 { position: absolute; left: 165px; top: 240px; } .btn3 { position: absolute; left: 165px; top: 280px; } .btn4 { position: absolute; left: 165px; top: 320px; } .btn5 { position: absolute; left: 165px; top: 360px; } .btn6 { position: absolute; left: 165px; top: 400px; } .btn7 { position: absolute; left: 165px; top: 440px; } .btn8 { position: absolute; left: 165px; top: 480px; } .link1 { position: absolute; left: auto; top: 240px; } .link2 { position: absolute; left: auto; top: 280px; } .link3 { position: absolute; left: auto; top: 320px; } .link4 { position: absolute; left: auto; top: 360px; } .link5 { position: absolute; left: auto; top: 400px; } .link6 { position: absolute; left: auto; top: 440px; } .link7 { position: absolute; left: auto; top: 480px; } .link8 { position: absolute; left: auto; top: 520px; } .link9 { position: absolute; left: auto; top: 560px; } #nav, #nav ul { padding: 0; margin: 0; list-style: none; } #nav a { display: block; width: 100px; } #nav li { width: 100px; } #nav li ul { position: absolute; width: 100px; left: -9999px; display: none; top: 0; z-index: 3; } #nav li:hover ul { display: block; left: 266px; z-index: 3; } #nav li:over ul { display: block; left: 266px; z-index: 3; } PHP Code: <ul id="nav"> <li><a href="HOBmain.htm"><img class="btn1" src="../mainbtn.gif" width="100" height="38" alt="MainBtn"></a></li> <li><a href="HOBmain.htm"><img class="btn2" src="../blogbtn.gif" width="100" height="38" alt="BlogBtn"></a> <ul> <li class="link1"><a href=""><img src="../mbtn.gif" alt="bMainBtn"></a></li> <li class="link2"><a href="#"><img src="../anmbtn.gif" alt="bAnimeBtn"></a></li> <li class="link3"><a href="#"><img src="../mgabtn.gif" alt="bMangaBtn"></a></li> <li class="link4"><a href="#"><img src="../gmebtn.gif" alt="bGameBtn"></a></li> <li class="link5"><a href="#"><img src="../bookbtn.gif" alt="bBookBtn"></a></li> </ul> </li> <li><a href="HOBmuse.htm"><img class="btn3" src="../musebtn.gif" width="100" height="38" alt="MuseBtn"></a> <ul> <li class="link2"><a href="HOBmuse.htm"><img src="../mbtn.gif" alt="mMainBtn"></a></li> <li class="link3"><a href="HOBmuse.htm"><img src="../pmbtn.gif" alt="mPoemBtn"></a></li> <li class="link4"><a href="HOBmuse.htm"><img src="../stybtn.gif" alt="mStoryBtn"></a></li> <li class="link5"><a href="HOBmuse.htm"><img src="../drmbtn.gif" alt="mDreamBtn"></a></li> </ul> </li> <li><a href="HOBodd.htm"><img class="btn4" src="../oddbtn.gif" width="100" height="38" alt="ComicBtn"></a> <ul> <li class="link3"><a href="HOBodd.htm"><img src="../mbtn.gif" alt="cMainBtn"></a></li> </ul> </li> <li><a href="HOBart.htm"><img class="btn5" src="../artbtn.gif" width="100" height="38" alt="ArtBtn"></a> <ul> <li class="link4"><a href="HOBart.htm"><img src="../mbtn.gif" alt="aMainBtn"></a></li> <li class="link5"><a href="HOBart.htm"><img src="../recbtn.gif" alt="aRecentBtn"></a></li> <li class="link6"><a href="HOBart.htm"><img src="../gaibtn.gif" alt="aGaiaBtn"></a></li> </ul> </li> <li><a href="HOBpic.htm"><img class="btn6" src="../picbtn.gif" width="100" height="38" alt="PicsBtn"></a> <ul> <li class="link5"><a href="HOBpic.htm"><img src="../mbtn.gif" alt="pMainBtn"></a></li> <li class="link6"><a href="HOBpic.htm"><img src="../recbtn.gif" alt="pRecentBtn"></a></li> </ul> </li> <li><a href="HOBfaq.htm"><img class="btn7" src="../faqbtn.gif" width="100" height="38" alt="FaqBtn"></a></li> <li><a href="HOBcon.htm"><img class="btn8" src="../contactbtn.gif" width="100" height="38" alt="ContactBtn"></a> </li> </ul> <script type="text/javascript" src="drop_down.js"></script> the "nav" is referring to a bit of js, and this is in my header. Also not sure if it's correct, but I can worry about that later. link: The Page Hi all, I've got a horizontal menu that is working just fine in every browser but IE 6 and 7. In IE it's almost there, except that the submenus will only appear one level deep. The menu is created with nested lists. The :hover functionality is simulated via JavaScript for IE 6. The IE developer toolbar shows the 3rd level menu is correctly being changed to display: block when its parent is hovered, and the border the dev toolbar draws even puts it in the correct place, it just doesn't actually appear. You can find the page he http://www.perceptes.com/topdog/ The CSS and JS (uses jQuery) can be found he http://www.perceptes.com/topdog/css/screen.css http://www.perceptes.com/topdog/css/ie.css (loaded with a conditional comment) http://www.perceptes.com/topdog/js/tdps.js http://www.perceptes.com/topdog/js/ie.js (loaded with a conditonal comment) For a specific example of what I'm talking about, try hovering over the second item, Filters & Parts. This will give you another level with four choices. Each of those also has child elements, but when hovered over, the next level doesn't appear. Try it in something other than IE 6 or 7 to see how it's supposed to look. Thanks very much in advance! Hi everyone, For years I've been using tables solely to position elements on web pages but it's come to my attention that this is now "frowned" upon in the web community so I figured if I'm going to start doing things the more common way (with DIVs) I might as well start now. I'm not a professional website developer (C programmer here...eek! haha), but I do part time web work for some important clients of mine. So I have a very simple layout done with DIVs/CSS to start (code at the bottom). The problem is when you render it you'll see a large gap between the bottom of the layout and bottom of the page. My hypothesis is that this is due to where the "DIVs" would normally have been, except I moved them around. It sounds very similar to the problem encountered he http://forums.devshed.com/css-help-116/how-to-remove-blank-space-at-bottom-554773.html but I don't see what he did to solve it. Note that ultimately what I want is only the "header" and "footer" to have a fixed width/height. The leftcol and content should have fixed widths, but height grow with what ever is in them. And it should be centered in the page the way it is now. I tried various "text-wrap" and "height: 100%" and a few different codes but no luck. I really don't want to have to give up on DIV's but I am finding them a tad frustrating . I've altered the code from here (http://www.devarticles.com/c/a/Web-Style-Sheets/DIV-Based-Layout-with-CSS/3/). I tried "floating" them but that didn't seem to help either or is messes up my centering, plus I don't want it expanding to different resolutions. Thanks in advance if you can give a DIV newbie a heads up. Code: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>TWO-COLUM FIXED LAYOUT WITH FIXED BOXES</title> <style type="text/css"> <!-- #header { background: #0f0; position: relative; z-index: 1; top: 0px; left: 0px; width: 800px; height: 100px; } #leftcol { background: #f00; position: relative; z-index: 2; top: 0px; left: -325px; width: 150px; height: 600px; } #content { background: #ff0; position: relative; z-index: 3; top: -600px; left: 75px; width: 650px; height: 600px; } #footer { background: #0f0; position: relative; z-index: 4; top: -600px; left: 0px; width: 800px; height: 100px; } --> </style> </head> <body style="margin: 0pt;"> <div align="center"> <div id="header">Header Section</div> <div id="leftcol">Left Section <p align="left"> Test </p> </div> <div id="content">Content Section</div> <div id="footer">Footer Section</div> </div> </body> </html> I working on a CSS to display a round-shouldered-tab menu. My result is acceptable: http://rickduley.webs.com/roundShoulderTabMenu.jpg except for the fact that the tabs are set below the menuBar on which the are supposed to display. I have run out of ideas. Would someone please set me on the right path? Thanks. P.S.: the code is at http://rickduley.webs.com/roundShoulderTabMenu.zip.kgb - you have to delete the 'dot key gee bee' suffix. I have a two column DIV arrangment (inside a one coulmn page layout), and above it, I want a single div that will contain absolut positioned images. Here's the two column CSS: Quote: /* 2 column div setup for map and sidebar */ #mapwrap { width:980px; margin:0 auto; } #mapmain { float:right; width:680px; } #mapsidebar { float:left; width:300px; } #testimg { position:relative; left:100px; top:150px; } And... Code: <div id="buttondiv"><img src="/images/buttons/7on.png" id="testimg"></div> <div id="mapwrap"> <div id="mapsidebar"> <div id="findaddydiv"> Something </div> </div> <div id="mapmain"> Something Else </div> </div> My problem is that when I build the DIV for the images in the code above the two column set-up, and view the whole thing, the images are ON TOP of the two coulun DIVs. How to force the image DIV to be ABOVE the two-column set-up? I have a page with a bunch of DIVs i'm trying to get positioned correctly. I want to have two DIVs sit next to each other, so I float one, right? I can get them to sit next to each other, but then the top line of the content in the 2nd DIV sinks down below the floated div. I can't get it to work. Any help? CSS: Code: html{} body{ color: #000000; margin: 0; padding: 0; background-color: #666666; } .container{ height: auto; width: 650px; margin: 0px 0px 0px 0px; background-color: #333333; } /* Container Styles */ #news{ float:left; position:relative; width: 295px; background-color: #FFF; margin: 0px 0px 10px 25px; } #contact{ width: 295px; background-color: #FFF; margin: 0px 0px 10px 0px; position:relative; left: 325px; } HTML: Code: <div class="container"> <div id="news"> <h2>News</h2> <ul class="newslist"> <li>12.11.03 + news text...</li> <li>11.12.02 + more news text...</li> </ul> </div> <div id="contact"> <h2>Contact</h2> <ul class="contactlist"> <li><a href="#">mail be...</a></li> <li><a href="#">Design by ....</a></li> </ul> </div> </div> Thanks! I am learning css and ran into a problem I can't figure out. When I add text in my main content div, it does push my footer down like I want it to. However, it keeps the existing space in the div between the content and the footer leaving a large gap at the bottom of the screen. Can anybody help me? The developing site is he thinkfishdesign - dot - com/temp/tf/ This is the css code : Code: @charset "utf-8"; /*------------------- Style Template -------------------*/ /*------------------- HTML Styles -------------------*/ body { text-align: center; margin: 0px; background-color: #FFF; } p { font-family:Arial, Helvetica, sans-serif; font-size: 1em; line-height: 1.3em; } /*------------------- Structural Styles -------------------*/ #container-content { position:relative; margin:0 auto; height:auto; width:980px; height:auto; text-align:left; } #container-page { position:relative; width:100%; height:auto; text-align:center; } #content-container { position:relative; top:-17em; width:100%; } #content { position:relative; left:13em; top:-33em; width:45em; } #content-main { position:relative; width:100%; height:auto; } #footer { position:relative; top:0em; width:100%; height:12.6em; } .footer { background-image:url(images/template_footer.jpg); background-repeat:no-repeat; } #intro { position:relative; left:20em; top: -34em; width:38em; height:8.8em; white-space:normal; } #logo { position:relative; left:50em; top:-19em; width:11em; height:11em; } .logo { background-image:url(images/template_logo.jpg); background-repeat:no-repeat; } #photo-main { position:relative; left:1em; top:1em; width:16em; height:20em; } .photo-main { background-image:url(images/template_fish.jpg); background-repeat:no-repeat; } /*------------------- Side Navigation Styles -------------------*/ #nav-container { position:relative; left:1.3em; top:-12em; width:12em; height:19em; } .nav { font-family:Arial, Helvetica, sans-serif; font-size: .8em; line-height: 1em; } .link-nav a { color: #000; text-decoration: none; } .link-nav a:visited { color: #000; text-decoration: none; } .link-nav a:hover { color: #F60; text-decoration: underline; } /*------------------- Footer Navigation Styles -------------------*/ #footer-nav{ position:relative; top:13em; left:3em; width:40em; height:2em; } .nav-footer { font-family:Arial, Helvetica, sans-serif; font-size: .8em; line-height: 1em; } .link-footer a { color: #F60; text-decoration: underline; } .link-footer a:visited { color: #F60; text-decoration: underline; } .link-footer a:hover { color: #900; text-decoration: underline; } I am trying to place an element in a page that will over lap other elements. If I use position: relative; the element (a div cell) gets to far down on the page. If I use position: absolute to specify the verical position but not the horizontal it works perfectly in Firefox, but not IE (because IE requires both a vertical and horizontal specification in their abosolute positioning) works in Firefox, but not IE Code: position: absolute; top: 170px; I cant specify a horizontal position because the div cell needs to be inside another cell that is centered (so when the window is resized the main cell moves around. Here is the page because I'm sure my explanation is confusing. http://www.davenport-rock.com/news.php If you look at it in fire fox it looks good, but in IE, its not lined up right. Does someone know how to make this work in IE (and other browsers)? |