CSS - Ie7 Issue With Superfish Menus
I'm using a drop down and fly out menu that uses Superfish with a little modified CSS to style it differently. It works just fine in everything but IE7 (even IE6 works!), where the third level menus drop down (incorrectly bumping the rest of the second level menu down in the process) like the second level menus instead of flying out to the right like they're supposed to.
I've tried every combination of clear, float, and positioning settings I can think of and none fixed the issue for IE7. Has anyone run into this with Superfish before or see where my mistake is? Thanks very much in advance. Here is the page in question: http://kc-lawyers.einsteinwebsites.com/ Similar TutorialsHello my helpful comrades, I'm having some problems with the ol' Suckerfish in IE. It seems the second list is floating left, insead of appearing beneath the first list, and "clear:" won't fix it. I've been looking over the CSS all morning, but can't seem to locate the problem. The menus display perfectly in Fx. I have a feeling a lack of sleep is making me mildly stupid, but the slow progress thus far has driven me to seek help I've put the menu in a seperate .css file from the main layout to make it easier to read: CSS HTML Cheers! I have a menu that needs to be pixel perfect. It uses ID's for each menu item with a specific width and background positioning property when the user hovers over the each menu item. This is fine so far. It is getting tricky now because I need to use a drop down menu. Using the Superfish js, it uses a class (sfHover) appended on the parent ul when the child li is hovered. That would be fine if it were a mere background colour but in this case I need to control background positioning. eg li#main-nav-3 a:hover{ width:83px; background position:-227px 0;} ... <li id="main-nav-3"><a href="#">Attractions</a></li> <li id="main-nav-3" =><a href="#">Business</a> <ul> <li><a href="#">dummy link</a></li> <li><a href="#">dummy link</a></li> <li><a href="#">dummy link</a></li> <li><a href="#">dummy link</a></li> <li><a href="#">dummy link</a></li> </ul> </li> ... on rollover: ... <li id="main-nav-3" class="sfHover"><a href="#">Attractions</a></li> <li id="main-nav-3" =><a href="#">Business</a> <ul> <li><a href="#">dummy link</a></li> <li><a href="#">dummy link</a></li> <li><a href="#">dummy link</a></li> <li><a href="#">dummy link</a></li> <li><a href="#">dummy link</a></li> </ul> </li> ... I just wish you could write li#main-nav-3.sfHover a:hover {new background position} to solve this but you can't. Anyone else faced a similar problem? Link to the problem page: http:sidouglas.net/cmx/tourism/ The rollovers are : Business a nd About NZ. I've been bashing my head with this problem for several days now and i've tried lots and lots of methods with no good result. now, i'm out of ideas. I want to use the superfish/suckerfish menu from : jquery plugin's home The problem is that i want to show the second ul submenu (the one that extends from the first) ~50px to the left over the first ul menu. see the problem in the attached image. it works fine in firefox, but in internet explorer 6 & 7 the second ul submenu is shown below the first one. i thought its a problem with z-index or something but i can't get it to work. here is the html code : Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <title>A very basic Superfish menu example</title> <meta http-equiv="content-type" content="text/html;charset=utf-8"> <link rel="stylesheet" type="text/css" href="css/superfish.css" media="screen"> <script type="text/javascript" src="js/jquery-1.2.6.min.js"></script> <script type="text/javascript" src="js/hoverIntent.js"></script> <script type="text/javascript" src="js/superfish.js"></script> <script type="text/javascript"> // initialise plugins jQuery(function(){ jQuery('ul.sf-menu').superfish(); }); </script> <style type="text/css" media="screen" id="test"> .test {margin-left:-50px;margin-top:10px;position:absolute;z-index:9999;} </style> </head> <body> <ul class="sf-menu"> <li class="current"> <a href="#a">menu item ↓</a> <ul> <li> <a href="#aa">menu item that is quite long</a> </li> <li class="current"> <a href="#ab">menu item →</a> <ul class="test"> <li class="current"><a href="#">menu item</a></li> <li><a href="#aba">menu item</a></li> <li><a href="#abb">menu item</a></li> <li><a href="#abc">menu item</a></li> <li><a href="#abd">menu item</a></li> </ul> </li> <li> <a href="#">menu item →</a> <ul> <li><a href="#">menu item</a></li> <li><a href="#">menu item</a></li> <li><a href="#">menu item</a></li> <li><a href="#">menu item</a></li> <li><a href="#">menu item</a></li> </ul> </li> <li> <a href="#">menu item →</a> <ul> <li><a href="#">menu item</a></li> <li><a href="#">menu item</a></li> <li><a href="#">menu item</a></li> <li><a href="#">menu item</a></li> <li><a href="#">menu item</a></li> </ul> </li> </ul> </li> <li> <a href="#">menu item</a> </li> <li> <a href="#">menu item ↓</a> <ul> <li> <a href="#">menu item →</a> <ul> <li><a href="#">short</a></li> <li><a href="#">short</a></li> <li><a href="#">short</a></li> <li><a href="#">short</a></li> <li><a href="#">short</a></li> </ul> </li> <li> <a href="#">menu item →</a> <ul> <li><a href="#">menu item</a></li> <li><a href="#">menu item</a></li> <li><a href="#">menu item</a></li> <li><a href="#">menu item</a></li> <li><a href="#">menu item</a></li> </ul> </li> <li> <a href="#">menu item →</a> <ul> <li><a href="#">menu item</a></li> <li><a href="#">menu item</a></li> <li><a href="#">menu item</a></li> <li><a href="#">menu item</a></li> <li><a href="#">menu item</a></li> </ul> </li> <li> <a href="#">menu item →</a> <ul> <li><a href="#">menu item</a></li> <li><a href="#">menu item</a></li> <li><a href="#">menu item</a></li> <li><a href="#">menu item</a></li> <li><a href="#">menu item</a></li> </ul> </li> <li> <a href="#">menu item →</a> <ul> <li><a href="#">menu item</a></li> <li><a href="#">menu item</a></li> <li><a href="#">menu item</a></li> <li><a href="#">menu item</a></li> <li><a href="#">menu item</a></li> </ul> </li> </ul> </li> <li> <a href="#">menu item</a> </li> </ul> </body> </html> here is the css code : Code: /*** ESSENTIAL STYLES ***/ .sf-menu, .sf-menu * { margin: 0; padding: 0; list-style: none; } .sf-menu { line-height: 1.0; } .sf-menu ul { position: absolute; top: -999em; width: 10em; /* left offset of submenus need to match (see below) */ } .sf-menu ul li { width: 100%; } .sf-menu li:hover { visibility: inherit; /* fixes IE7 'sticky bug' */ } .sf-menu li { float: left; position: relative; } .sf-menu a { display: block; position: relative; } .sf-menu li:hover ul, .sf-menu li.sfHover ul { left: 0; top: 2.5em; /* match top ul list item height */ z-index: -1; } .current:hover sf-menu li { position:absolute;z-index:-5; } ul.sf-menu li:hover li ul, ul.sf-menu li.sfHover li ul { top: -999em; } ul.sf-menu li li:hover ul, ul.sf-menu li li.sfHover ul { left: 10em; /* match ul width */ top: 0; position:absolute;z-index:999; } ul.sf-menu li li:hover li ul, ul.sf-menu li li.sfHover li ul { top: -999em; } ul.sf-menu li li li:hover ul, ul.sf-menu li li li.sfHover ul { left: 10em; /* match ul width */ top: 0; } /*** DEMO SKIN ***/ .sf-menu { float: left; margin-bottom: 1em; } .sf-menu a { border-left: 1px solid #fff; border-top: 1px solid #CFDEFF; padding: .75em 1em; text-decoration:none; } .sf-menu a, .sf-menu a:visited { /* visited pseudo selector so IE6 applies text colour*/ color: #13a; } .sf-menu li { background: #BDD2FF; } .sf-menu li li { background: #AABDE6; } .sf-menu li li li { background: #9AAEDB; } .sf-menu li:hover, .sf-menu li.sfHover, .sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active { background: #CFDEFF; outline: 0; } /*** arrows **/ .sf-menu a.sf-with-ul { padding-right: 2.25em; min-width: 1px; /* trigger IE7 hasLayout so spans position accurately */ position:relative;z-index:-1; } .test a {position:relative;z-index:555;} .sf-sub-indicator { position: absolute; display: block; right: .75em; top: 1.05em; /* IE6 only */ width: 10px; height: 10px; text-indent: -999em; overflow: hidden; background: url('../images/arrows-ffffff.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */ } a > .sf-sub-indicator { /* give all except IE6 the correct values */ top: .8em; background-position: 0 -100px; /* use translucent arrow for modern browsers*/ } /* apply hovers to modern browsers */ a:focus > .sf-sub-indicator, a:hover > .sf-sub-indicator, a:active > .sf-sub-indicator, li:hover > a > .sf-sub-indicator, li.sfHover > a > .sf-sub-indicator { background-position: -10px -100px; /* arrow hovers for modern browsers*/ } /* point right for anchors in subs */ .sf-menu ul .sf-sub-indicator { background-position: -10px 0; } .sf-menu ul a > .sf-sub-indicator { background-position: 0 0; } /* apply hovers to modern browsers */ .sf-menu ul a:focus > .sf-sub-indicator, .sf-menu ul a:hover > .sf-sub-indicator, .sf-menu ul a:active > .sf-sub-indicator, .sf-menu ul li:hover > a > .sf-sub-indicator, .sf-menu ul li.sfHover > a > .sf-sub-indicator { background-position: -10px 0; /* arrow hovers for modern browsers*/ } /*** shadows for all but IE6 ***/ .sf-shadow ul { background: url('../images/shadow.png') no-repeat bottom right; padding: 0 8px 9px 0; -moz-border-radius-bottomleft: 17px; -moz-border-radius-topright: 17px; -webkit-border-top-right-radius: 17px; -webkit-border-bottom-left-radius: 17px; } .sf-shadow ul.sf-shadow-off { background: transparent; } i'm not adding the javascript because i believe that the problem is from css ... can anyone help me ? image : URL Please help me. This is driving me crazy. I am getting a problem in IE and I can't seem to figure out how to fix it. Of course, it works just fine in Firefox, but not IE. In IE, go to to this page. On the horizontal drop-down menu, go to "Guides." Then scroll through the three drop-down options and back up. Notice how the 3rd level menu suddenly dissapears behind the 2nd level menu? Here's the portion of my CSS file controling the menu: Code: /********** LAYOUT - HEADER **********/ #header {background: #ffffff; margin-top: 10px; margin-bottom: 25px; padding: 0 0 8px;} img.headerimg {margin-left: 25px;} /** NAV - top horizontal nav **/ #nav, #nav ul {padding: 0; margin: 0; list-style: none} #nav {height:1.5em; font: 80% arial; margin-top: 1em; margin-left: 75px;} #nav li {position:relative; float: left; width: auto; display:block; margin: 0; padding:0} #nav a {display: block; padding: 3px 10px 2px; border-bottom: 1px solid rgb(98,61,15); border-top: 1px solid rgb(98,61,15);} /************* 2nd tier *************/ #nav li ul {width: 15em; position: absolute; left: -999em; background: #ffffff} #nav li:hover ul, #nav li.sfhover ul {left: 10px; z-index:55555} #nav li li {background:#9BCD9B; float:none; border: 1px solid rgb(98,61,15); border-top: none; padding-left: 0} #nav li li a, #nav li li a:link, #nav li li a:visited, #nav li li a:hover {color:#000; padding: 3px 10px; border-bottom: none; border-top: none;} #nav li li a:hover {color: #000; background: #FFDAB9;} #nav li.active {background: #FFDAB9;} #nav li.active a {color: #000000} /************* 3rd tier *************/ #nav li ul ul {width: 30em; font-size: 100%; margin-left: 7em; margin-top: -.7em} #nav li:hover ul ul, #nav li.sfhover ul ul {left: -999em;} #nav li li:hover ul, #nav li li.sfhover ul {left: auto;} #nav li li li {background: #f6f6f6; border-top: 1px solid #fff;} #nav li li li a, #nav li li li a:link, #nav li li li a:visited, #nav li li li a:hover {color: #006400} /************* 4th tier *************/ #nav li ul ul ul{width: 30em;} #nav li:hover ul ul ul, #nav li.sfhover ul ul ul {left: -999em;} #nav li li li:hover ul, #nav li li li.sfhover ul {left: auto;} #nav li li li li {background: #FFDAB9;} #nav li li li li a:hover {color: #000; background: #9BCD9B;} Please help me! Thanks! Manny Hi there. I've become fond of the idea of non-javascript menus. I've been experimenting a little. So with help from various sources I managed to get a simple set working. I have this... Code: #menu ul li > ul { display: none; position: absolute; top: 18px; left: 0; width: 170px; } which correctly 'hides' the sub-menu. Then I have this Code: #menu ul li:hover > ul { display: block; } which should 'unhide' the sub-menu. Now, because I'd had success with the menu, I thought I should now look at validating my html and css. So far, I've just looked at the html part. My question is, why does it work with this code (which doesn't validate under Strict doctype)? Code: <div id="menu"> <ul> <li class="small"><a href="blah.php">About</a> <li>Details On... <ul> <li class="small"><a href="blah.php">Registering</a> </ul> </ul> </div> and not this (which does validate)? Code: <div id="menu"> <ul> <li class="small"><a href="blah.php">About</a></li> <li>Details On...</li> <li> <ul> <li class="small"><a href="blah.php">Registering</a></li> </ul> </li> </ul> </div> I'll listen to any thoughts on this, even the use (or not) of doctype strict. Thanks for listening! Stay JOLLY H Hi, I wanted to do a horizontal popout menu. I have the code and it works but I am trying to undertsand it better. It uses a csshover.htc file which i didn't download but the thing still works fine with a ie sniffer code in it. It doesn't use any javascript which I thought it needed. There seems a few ways to do expanding menus in css (with/without javascript)? Menus are more complicated than they look but I would some explanation on the above points before i continue. Hi All, I seem to have made a mistake in installing a CSS drop-down menu b/c despite my best efforts, I cannot seem to make it work in Internet Explorer. I am using the Suckerfish method found http://www.alistapart.com/articles/dropdowns My CSS file is here And a sample page can be found here Does anyone see a mistake I made? All other browsers work beautifully, so the problem must lie in the Internet Explorer hack. I have this test site using CSS drop down menus, but when you scroll over, they disappear. Seems to be happening in IE9, Firefox and Chrome. Can't figure it out. Any help would be appreciated! Here is the script: Code: <head> <title>Untitled Document</title> <style type="text/css"> body {background-color: #FFFFFF; font-family: verdana, arial; font-size: 10pt; font-weight: bold; color: #0000ff;} .box1 { width: 1000px; height: 600px; position:relative; left: 150px; top: 0px; } .blue_box { width: 900px; position:absolute; top: 5px; left: 20px; height: 15px; } .box2 { width: 1050px; position:absolute; top: 40px; left: 20px; height: 15px; z-index: 2; } .main_image { position: relative; top: 3px; } .pic_box { width: 738px; /* 10px longer than actual jpg */ position:absolute; top: 75px; height: 167px; left: 20px; z-index; 1; } .text_box1 { width: 738px; position:absolute; top: 218px; height: 159px; left: 26px; border-color: #ff0000; } .education_box { width: 881px; position:absolute; top: 321px; height: 350px; left: 21px; } .top_news_box { width: 136px; position:absolute; top: 1px; height: 317px; margin-left: 5px; left: 715px; border-color: #ff0000; } /*Credits: Dynamic Drive CSS Library */ /* Top menu */ .menu ul{ padding: 3px 0; margin-left: 0; margin-top: 1px; margin-bottom: 0; font: bold 12px Verdana; list-style-type: none; text-align: center; /*set to left, center, or right to align the menu as desired*/ } .menu li{ display: inline; margin: 0; } .menu li a{ text-decoration: none; padding: 5px 7px; margin-right: 5px; border: 1px solid #778; color: white; background: #3282c2; border-radius: 8px; /*w3c border radius*/ box-shadow: 3px 3px 4px rgba(0,0,0,.5); /* w3c box shadow */ -moz-border-radius: 8px; /* mozilla border radius */ -moz-box-shadow: 3px 3px 4px rgba(0,0,0,.5); /* mozilla box shadow */ background: -moz-linear-gradient(center top, #a4ccec, #72a6d4 25%, #3282c2 45%, #357cbd 85%, #72a6d4); /* mozilla gradient background */ -webkit-border-radius: 8px; /* webkit border radius */ -webkit-box-shadow: 3px 3px 4px rgba(0,0,0,.5); /* webkit box shadow */ background: -webkit-gradient(linear, center top, center bottom, from(#a4ccec), color-stop(25%, #72a6d4), color-stop(45%, #3282c2), color-stop(85%, #357cbd), to(#72a6d4)); /* webkit gradient background */ } .menu li a { background: darkred; background: -moz-linear-gradient(center top, #f5795d, #e55e3f 25%, #d02700 45%, #e55e3f 85%, #f5795d); background: -webkit-gradient(linear, center top, center bottom, from(#f5795d), color-stop(25%, #e55e3f), color-stop(45%, #d02700), color-stop(85%, #e55e3f), to(#f5795d)); } .menu li a:hover{ color: #FFFFFFF; background:#0033CC; } /* Drop down menu buttons */ .blue ul { /* For all tags under <ul> (main and sub) */ padding: 3px 0; margin-left: 0; margin-top: 1px; margin-bottom: 0; font: bold 10pt Verdana; list-style-type: none; text-align: center; /*set to left, center, or right to align the menu as desired*/ } .blue li { /* Sets the properties associated with <li> */ display: inline; /* Sets li tags horizontal(main and sub) */ position: relative; margin: 0; } .blue li a { /* Sets the properties associated for all anchor tags */ text-decoration: none; padding: 5px 7px; margin-right: 15px; /* Sets margin to 15px, which spaces out each menu button by 15px */ border: 1px solid #778; color: white; background: #3282c2; border-radius: 8px; /*w3c border radius*/ box-shadow: 3px 3px 4px rgba(0,0,0,.5); /* w3c box shadow */ -moz-border-radius: 8px; /* mozilla border radius */ -moz-box-shadow: 3px 3px 4px rgba(0,0,0,.5); /* mozilla box shadow */ background: -moz-linear-gradient(center top, #a4ccec, #72a6d4 25%, #3282c2 45%, #357cbd 85%, #72a6d4); /* mozilla gradient background */ -webkit-border-radius: 8px; /* webkit border radius */ -webkit-box-shadow: 3px 3px 4px rgba(0,0,0,.5); /* webkit box shadow */ background: -webkit-gradient(linear, center top, center bottom, from(#a4ccec), color-stop(25%, #72a6d4), color-stop(45%, #3282c2), color-stop(85%, #357cbd), to(#72a6d4)); /* webkit gradient background */ } .blue li ul { /* Sets the properties for all li ul (sub menus). Rest is inherited */ position: absolute; /* All settings (e.g. left, top, etc.) will be relative to the top menu buttons (non sub menu buttons) */ left: 1px; display: none; /* Blocks all sub menu tags */ } .blue li:hover ul{ display: block; /* Shows all elements under each other (as opposed to next to each other) */ } .blue li:hover ul a { position: absolute; width: 150px; top: 5px; /* Amount of space the first sub menu starts from the parent button */ border-radius: 8px; text-decoration: none; background-color: #0000FF; padding: 5px; /* Pads area around text 5x in all 4 directions */ border: 1px solid #cccccc; border-bottom: 0; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt; font-weight: bold; color: #FFFFFF; } </style> </head> <body> <div class="box1"> <div class="blue_box"> <div class="menu"> <ul> <li><a href="">Join MSSNY</a></li> <li><a href="">Pay Dues On Line</a></li> <li><a href="">Directory Questionaire</a></li> <li><a href="">MSSNYPAC</a></li> <li><a href="">Grassroots Action Center</a></li> <li><a href="">Member Login</a></li> </ul> </div><!-- Close menu --> </div><!-- Close box2 --> <div class="box2"> <div class="blue"> <ul> <li><a href="#">Home</a></li> <li><a href="#">About MSSNY</a> <ul> <li><a href="#">Divisions</a></li> <li><a href="#">Governance</a></li> <li><a href="#">Committees</a></li> <li><a href="#">Member Sections</a></li> <li><a href="#">House of Delegates</a></li> <li><a href="#">Position Statements</a></li> <li><a href="#">By Laws</a></li> <li><a href="#">Contact Us</a></li> </ul> </li> <li><a href="#">Membership</a> <ul> <li><a href="#">Applications</a></li> <li><a href="#">Pay Dues Online</a></li> <li><a href="#">AAPI Physicians</a></li> <li><a href="#">NYS Medical Directory</a></li> </ul> </li> <li><a href="#">Medical Community</a> <ul> <li><a href="#">County Societies</a></li> <li><a href="#">Speciality Societies</a></li> <li><a href="#">State Societies</a></li> <li><a href="#">Ethnic Medical Associations</a></li> <li><a href="#">American Medical Association</a></li> <li><a href="#">NYS Department of Health</a></li> <li><a href="#">Additional Medical Links</a></li> </ul> </li> <li><a href="#">Public Health</a> <ul> <li><a href="#"></a></li> <li><a href="#"></a></li> <li><a href="#"></a></li> <li><a href="#"></a></li> </ul> </li> <li><a href="#">Physician Advocacy</a> <ul> <li><a href="#"></a></li> <li><a href="#"></a></li> <li><a href="#"></a></li> <li><a href="#"></a></li> </ul> <li><a href="#">Practice Resources</a> <ul> <li><a href="#">WCB Guidelines and Fee Schedule</a></li> <li><a href="#">EHR Implementation Services</a></li> <li><a href="#">CME Physicial Education</a></li> <li><a href="#">MSSNY Online Library</a></li> </ul> </li> </ul> </div> <!-- Close blue --> </div> <!-- Close blue_box --> <div class="pic_box"><img src="050211a_Original.jpg" class="main_image" width="691" height="136" border="0" /> <!-- Close top_news_Box --> <div class="top_news_box"> <p><img src="Facebook-Twitter-Linkedin.JPG" border="0" /></p> <p>Visit the MSSNY Blog Forum. .</p> <p>News of New York<br /> Rate Card and Classifieds </p> <p> MSSNY eNews 6/17/11 </p> <p>MSSNY Legal Resources </p> <p> *** Members Section *** <br /> Members: Click Here</p> <p> Non Members: <br /> Browse Our Benefits Join US </p> <p> <br /> </p> </div> </div> <!-- Close pic_box --> <div class="text_box1">To All New York Physicians: No Tort Reform HOD Ref. Comm. Documents Health Care Reform <br /> <br /> WCB Guidelines and Fee Schedule 6-Credit CME Course on New Workers Compensation <br /> Treatment Guidelines <br /> <br /> Influenza Surveillance: How to become an ILINET Provider for 2010-11 flu season <br /> </div> <div class="education_box"><img src="MED101014-Infection-Course-Image_1.jpg" width="263" height="219" border="0" /> <img src="MED100513-Course-Graphic.jpg" border="0" /></div> <!-- Close pic_box --> </div> </body> </html> Hi there, I'm trying to integrate some SEO friendly dropdown menus into an existing website design. The trouble I'm experiencing so far is that the body of the design is aligned centre, and most of the examples I've seen thus far use absolute positioning of <div> elements (i.e. the design is left-aligned, so the designer knows to position the dropdown div X pixels). Is there a good reference I can use for positioning my divs properly? Thanks I am very new to this whole css thing, but am trying to get all learned about it. I think I am doing badly so far. I am trying to make css drop-down menus, and have pulled code from all over the place, and modified it to look correct (so as to match my design comp). it is based on the suckerfish model <http://www.alistapart.com/articles/dropdowns/> and it works exactly as it should in safari, firefox (mac & pc). but doesn't work correctly at all in IE (mac or pc). I have implemented the "ie fix" with the javascript code several sites instructed me to use, and while it now sorta works (in the sense that the menus drop down), there are still problems. such as in IE on pc you can't roll down to the drop down menus, because they go away as soon as you roll off the top menu item. in IE on mac they are messed up in a whole other way. you can roll down to them, and they don't go away as soon as you're off the top nav option, but the hover is all jacked, and the menu is broken, sending the last nav button down to the next line! aaahhh! can anyone help me?! I'm sorry I'm so stupid and helpless, but... well. I am. any tips/etc would be mighty appreciated! -daniel Dear Forum, I am designing a website using HTML and Java for the drop down menus. Although for one page this seemed ok at the begining, now I want to add links to other catagories where I only want to change the main body of the page. Up to now I have had to insert the Java script into every page I want to link to. The problem is A) The pages blink and the menu is lost while the graphics are being loaded, B) If I need to change the menus in the future I have to change all pages. Is there a way I can use CSS to keep the consistency of the Top and sides of the page and only change the body for other pages. I can do this with frames but I prefer not to use them. The test page can be seen at http://test.kipseli.com Thanks Rob i have 2 menus on my page. one is a vertical sliding menu & other is a floating menu. i want the vertical sliding menu to slide over the floating menu. i tried giving the floating menu a z-index of -2 since the vertical menu has z-index of -1. but it doesn't work coz the floating menu disappears. the vertical menu is written with tables while the floating menu has a div tag around it. this is the style for the vertical menu Code: table.topnav {position: relative; top: 0; left: 0; padding-left: 2px; } table.menu {position: absolute; bottom: 0; z-index: -1; } .pad{padding-top: 2px;} .banner{z-index: 1; position: relative;} and this is the style for the floating menu Code: <script> if (!document.layers) document.write('<div id="divStayTopLeft" style="position:absolute">') </script> thank you xia I've been grappling with this for a long while now. I pretty much have it working, except for the life of me I cannot get the drop down menus to appear under the corresponding link. position: absolute makes the menus always appear off to the left. Does anyone know what the secret is to this? Code: <div id="nav_wrapper"> <div id="nav_bar"> <div id="nav_content"> <ul id="nav_ul"> <li><a href="/">Home</a></li> <li><a href="/forum/">Forum</a> <div class="nav_subcontent"> <ul> <li><a href="/forum/search.php">Search</a></li> <li><a href="/forum/memberlist.php">Members</a></li> </ul> </div> </li> <li><a href="#">A link without a menu</a></li> </ul> </div> </div> </div> Code: /* Wrapper */ #nav_wrapper { clear: both; } /* Bar */ #nav_bar { background: url('images/nav_swish_fade.jpg'); background-repeat: repeat-x; height: 36px; } /* All the buttons within the bar, the middle portion */ #nav_content { display: inline; margin: 0 auto; text-align: center; background: #fff; height: 36px; } /* Entire unordered list */ #nav_ul { list-style: none; position: relative; } /* Top level unordered list */ #nav_content ul>li { display: block; } /* Top level unordered list links */ #nav_content ul>li a { display: block; float: left; padding: 9px; margin-left: 2px; margin-right: 2px; } /* Menus */ .nav_subcontent { display: none; position: absolute; background: #222; margin-top: 8px; } /* Menu link */ #nav_content .nav_subcontent a { display: block; padding: 9px 20px 9px 0; margin-left: -5px; text-align: left; min-width: 100px; } /* Show menus */ #nav_content ul>li:hover .nav_subcontent { display: block; } Hello does anyone have any links to good tabs tutorials I been looking at some other and most of the CSS code would not work well but I would just like some links thanks for ur time Can someone recommend a workaround for this issue I am having please. Rollover the top blue menus to see what i mean. There is an advert appearing in an iframe and it is blocking the drop down menus above it. Z indexes etc don't seem to help. this is the link ( very frustrating you can't post a link - it would make things easier for people to help ) sidouglas.net/nz-tourism-guide-prototype/index.html index.html: Iframe source is the same as the domain; menu can appear above the iframe no problem. index2.html: iframe source references another domain; menu dissapears. index3.html: iframe source is same as domain - but references swf resources from another domain. menu dissapears. Surely someone has faced this same issue? I am tied down to having to a situation with index2.html as there has to be a click tracking registering from another domain. Very frustrating, please help. Thanks. Thank you for your time and assistance. I am working on building my first website in 2 years. I am very interested in developing a good site interface with standard code that may be easily edited later. Specifically, I am interested in creating dynamic navigation menus that will be supported by as many browsers as possible. I have seen dynamic menus created with javascript, but I know I don't want to do that since some browsers do not support it/or do not have it enabled by default. Can you comment on whether or not CSS would be a good solution to get around this problem? I have never used CSS to create menus in the past, but it seems very useful for standardizing a site interface. I am also open to other suggestions, what would you do to accomplish this task? I am learning CSS and started to like it I was trying to make an image gallery so was just playing around with this link I got Please see this http://www.cssplay.co.uk/menus/tabmenu.html When I added five more images in this, the last images ceases to display How can I correct that I was testing this by adding this code 5 times <li> <a href="#nogo"> William Turner<br /> (1775-1851) <span> <img src="../img/turner.jpg" alt="painting" title="painting" /> This English painter was one of the greatest romantic interpreters of nature in the history of Western art and is still unrivaled in the virtuosity of his painting of light. </span> </a> </li> I was anticipating that a scrollbar would come automatically in the browser but that dint happen What should I do? In today's Website Development world, which kind of Drop Down menus do the pro's prefer to use, pure CSS without Javascript or CSS with Javascript? And also, can pure CSS Drop Down menus be used in Dynamic Websites? Thank you. Hello, I'm trying to replace one CSS nav menu with another, is there anyone who is familiar enough to assist me? My web site has both a div/ul based drop down menu and expand/collapse menu on the site. I noticed that the drop down horizontal menu goes behind the images and links of the sidebar expand/collapse menu and snaps shut. I had to change the li to another word to get the 2 styles to not confict over the <li> tags and it still works fine, but It seems to have an issue being in the same area as the <ul> (which I cannot remove. To see the problem, visit http://web3.avemarialaw.edu/index.cfm?event=ProspectiveStudent And mouse over the 'Prospective Student' menu in the top hortizonal bar. You'll see it go behind the title images. Also if you mouse down to about the 3rd drop down link, it snaps shut, but only if your mouse is to the left side. The right side of the dropped menus is fine. I would like the drop down menu to go over the side bar and take priority over the side bar. I am including the css and the javascript for both the hortizonal drop down menu and the side bar expand / collapse. Also, both of the styles for the menus are in the same .css file. Not sure if that makes a difference or not. Drop Down: Code: Javascript <script type="text/javascript"> //SuckerTree Horizontal Menu (Sept 14th, 06) //By Dynamic Drive: http://www.dynamicdrive.com/style/ var menuids=["treemenu1"] //Enter id(s) of SuckerTree UL menus, separated by commas function buildsubmenus_horizontal(){ for (var i=0; i<menuids.length; i++){ var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul") for (var t=0; t<ultags.length; t++){ if (ultags[t].parentNode.parentNode.id==menuids[i]){ //if this is a first level submenu ultags[t].style.top=ultags[t].parentNode.offsetHeight+"px" //dynamically position first level submenus to be height of main menu item ultags[t].parentNode.getElementsByTagName("a")[0].className="mainfoldericon" } else{ //else if this is a sub level menu (ul) ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it ultags[t].parentNode.getElementsByTagName("a")[0].className="subfoldericon" } ultags[t].parentNode.onmouseover=function(){ this.getElementsByTagName("ul")[0].style.visibility="visible" } ultags[t].parentNode.onmouseout=function(){ this.getElementsByTagName("ul")[0].style.visibility="hidden" } } } } if (window.addEventListener) window.addEventListener("load", buildsubmenus_horizontal, false) else if (window.attachEvent) window.attachEvent("onload", buildsubmenus_horizontal) </script> CSS /* 3 Level drop down navigation for main */ .suckertreemenu ul{ margin: 0; padding: 0; list-style-type: none; } /*Top level list items* - Top Level Navigation*/ .suckertreemenu ul li { position: relative; display: inline; float: left; background-color: #FFCC33; /*overall menu background color!*/ } /*1st sub level menu*/ .suckertreemenu ul li ul { left: 0; width: 173px; position: absolute; top: 1em; /*no need to change, as true value set by script */ display: block; visibility: hidden; background-color: #DCD3B9; } /*Sub level menu list items (undo style from Top level List Items)*/ .suckertreemenu ul li ul li { display: list-item; float: none; background-color: #DCD3B9; } /*All subsequent sub menu levels offset after 1st level sub menu */ .suckertreemenu ul li ul li ul{ left: 159px; /* no need to change, as true value set by script */ top: 0; } /* Sub level menu links style */ .suckertreemenu ul li ul li a{ display: block; /*width: 160px; width of sub menu levels*/ color: #660000; font-family: Georgia, "Times New Roman", Times, serif; font-size:11px; font-weight:bolder; text-decoration: none; padding: 4px 1px 4px 7px; border-bottom: 1px solid #FFFFFF; /*Ouline color for drop down menus!*/ background-color: #DCD3B9; } .suckertreemenu ul li a:hover{ /*Changes the color of the menu as the mouse rolls over*/ background-color: #660000; color: #FFFF00; } /*Background image for top level menu list links */ .suckertreemenu .mainfoldericon{ background-color: #DCD3B9; } /*Background image for subsequent level menu list links */ .suckertreemenu .subfoldericon{ background-color: #DCD3B9; } * html p#iepara{ /*For a paragraph (if any) that immediately follows suckertree menu, add 1em top spacing between the two in IE*/ padding-top: 1px; } /* Holly Hack for IE \*/ * html .suckertreemenu ul li { float: left; height: 1%;} * html .suckertreemenu ul li a { height: 1%;} * html .suckertreemenu ul li ul li { float: left;} /*End 3 Level Main Navigation*/ Expand / Collapse: Code: Javascript <script language="javascript"> function toggle(id){ ul = "ul_" + id; img = "img_" + id; ulElement = document.getElementById(ul); imgElement = document.getElementById(img); if (ulElement){ if (ulElement.className == 'closed'){ ulElement.className = "open"; imgElement.src = "http://www.avemarialaw.edu/images/opened.gif"; }else{ ulElement.className = "closed"; imgElement.src = "http://www.avemarialaw.edu/images/closed.gif"; } } } </script> CSS /*Side Bar Nav*/ #menus { float: left; margin-left: -30px; padding-top:30px; width: 250px; position: relative; } .open { display: block; } .closed { display: none; } liv { /*Fix for confict between top level nav's <li>'s and sidebars*/ list-style-type: none; padding-top: .2em; padding-bottom: .2em; } liv img { vertical-align: middle; } /*End Side Bar Nav*/ |