CSS - Sons Of Suckerfish And Ie6 And Variable Width On Top Level
I am using the sons of suckerfish drop downs and have managed to produce css code that looks great in all browers, except IE6.
In IE6, the top level links stetch all the way across rather than fitting to the text of the link. I figure this is because #nav li is float:left, but #nav li a is display:block which for somereason IE thinks, lets stetch out even though my container says to float. So, can anyone help me keep variable width on top level links and display correctly in all browers? I know in sons of suckerfish they have stated that you must put a fixed width, but thats not an option for me. I don't have enough space to make all of them the same width. So here is the css and some sample code: Code: #nav { padding: 0; margin: 0; list-style:none; } #nav a { } #nav li { float:left; height:34px; line-height:34px; } #nav li a{ background: url(../images/site/nav-li-bg.gif) no-repeat right center; height: 34px; line-height:34px; padding: 0 8px 0 8px; font-weight: bold; font-size: 13px; font-family: "Trebuchet MS",Bitstream Vera Sans,Verdana; color: #626262; display:block; text-decoration:none; text-align:center; } #nav a:hover { text-decoration: none; color:#000; } #nav li ul { position: absolute; width: 200px; left:-999px; background: #fff; border: 1px solid #ADA8A5; list-style:none; margin:0; padding: 0; } #nav li:hover ul, #nav li.sfhover ul { left: auto; z-index:99; } #nav li ul li { width: 200px; margin: 0; padding: 0; z-index:99; } #nav li ul li a { display:block; float:none; font-size: 11px; font-family:verdana; width: 190px; height:auto; padding:5px; margin: 0; line-height:normal; font-weight:normal; color: #000; z-index:99; text-align:left; background: #fff; border-left: none; border-right:none; border-top:none; border-bottom: 1px solid #e7e7e7; } #nav li ul li a:hover { background: #a2c9f4; } Code: <ul id="nav"> <li><a href="">HOME</a> <ul> <li><a href="">Test</a></li> <li><a href="">test</a></li> <li><a href="">test</a></li> </ul> </li> <li><a href="">NEWS</a> <ul> <li><a href="">Latest News</a></li> <li><a href="">Hot News</a></li> <li><a href="">Submit a Story</a></li> </ul> </li> </ul> Similar TutorialsHi Everyone, I'm new here - have lurked on and off - great forum. I am using a suckerfish wordpress plug-in, it has been working fine until I added 3rd level of pages to the navigation. Still works fine in FF, Safari, Opera & Chrome but mis-aligns (offsets) 3rd level navigation to the right in IE 7 (not tested in IE8 or 6). I have attached screenshots of the problem. Correctly positioned in FF URL Mis-aligned in IE7 URL *Just realised that as a new user the imgage URLs are stripped - so I shall try to describe the problem. In most browsers the 3rd level navigation appears directly adjacent to the second level navigation. In IE it appears 80 or so pixels to the right with a gap in between making it impossible to access the 3rd level menu. The CSS is Code: #suckerfishnav { background:#81aaf2 url(../multi-level-navigation-plugin/images/suckerfish_JP.png) repeat-x; font-size:13px; font-family:verdana,sans-serif; font-weight:bold; width:100%; z-index: 1000; } #suckerfishnav, #suckerfishnav ul { float:left; list-style:none; line-height:34px; padding:0; margin:0; width:100%; } #suckerfishnav a { display:block; color:#dddddd; text-decoration:none; padding:0px 10px; z-index: 1000; } #suckerfishnav li { float:left; padding:0; z-index: 1000; } #suckerfishnav ul { position:absolute; left:-999em; height:auto; width:151px; font-weight:normal; margin:0; line-height:1; border:0; border-top:1px solid #666666; z-index: 1000; } #suckerfishnav li li { width:149px; border-bottom:1px solid #666666; border-left:1px solid #666666; border-right:1px solid #666666; font-weight:bold; font-family:verdana,sans-serif; z-index: 1000; } #suckerfishnav li li a {padding:4px 10px; width:130px;font-size:12px;color:#dddddd;}#suckerfishnav li ul ul {margin:-21px 0 0 150px;} #suckerfishnav li li:hover { background:#81aaf2; } #suckerfishnav li ul li:hover a, #suckerfishnav li ul li li:hover a, #suckerfishnav li ul li li li:hover a, #suckerfishnav li ul li li li:hover a {color:#dddddd;} #suckerfishnav li:hover a, #suckerfishnav li.sfhover a {color:#dddddd;} #suckerfishnav li:hover li a, #suckerfishnav li li:hover li a, #suckerfishnav li li li:hover li a, #suckerfishnav li li li li:hover li a {color:#dddddd;} #suckerfishnav li:hover ul ul, #suckerfishnav li:hover ul ul ul, #suckerfishnav li:hover ul ul ul ul, #suckerfishnav li.sfhover ul ul, #suckerfishnav li.sfhover ul ul ul, #suckerfishnav li.sfhover ul ul ul ul {left:-999em;} #suckerfishnav li:hover ul, #suckerfishnav li li:hover ul, #suckerfishnav li li li:hover ul, #suckerfishnav li li li li:hover ul, #suckerfishnav li.sfhover ul, #suckerfishnav li li.sfhover ul, #suckerfishnav li li li.sfhover ul, #suckerfishnav li li li li.sfhover ul { left:auto; background:#00a33d; } #suckerfishnav li:hover, #suckerfishnav li.sfhover { left:auto; background:#81aaf2; } I think perhaps the 3rd level navigation is inheriting a margin(?) from somewhere but I need someone with a bigger brain than mine to help me see it! Many thanks to anyone who can help. I tried to do this CSS drop down menu with 2 methods, but none of them work perfect. The first method is this: PHP Code: #menu1main { /* Top drop down menu styles */ height : 31px; display : block; } #menu1main a { /* Top drop down menu hover styles */ display : block; color : #000000; text-decoration : none; border : none; background-repeat : no-repeat; } .menu1 .menu1list { /* Hide top drop down menu submenu */ display : none; } .menu1, .display { /* Top drop down menu top level styles */ float : left; width : 110px; text-align : center; vertical-align : middle; font-family : Comic Sans MS; font-size : 10pt; line-height : 31px;} /* Top drop down menu submenu hover styles */ a.menu1b1lv1, a.menu1b1lv1:hover, a.menu1b1lv1:active { background-image : url('image/menu_banner_1.jpg'); background-position : 12px 50% ; } a.menu1b2lv1, a.menu1b2lv1:hover, a.menu1b2lv1:active { background-image : url('image/menu_banner_2.jpg'); background-position : 12px 50% ; } /* Top drop down menu submenu hover styles */ a.menu1lv2, a.menu1lv2:hover, a.menu1lv2:active { display : block; text-decoration : none; border : none; color : #000000; text-indent : 16px; text-align : left; font-size : 8pt; line-height : 20px; width : 130px; } a.menu1lv2:hover, a.menu1lv2:active { background-image : url('image/menu_cube_1.gif'); background-position : 0% 100% ; background-repeat : no-repeat; } a.menu1lv2:hover, a.menu1lv2:active, a.menu1b1lv1:hover, a.menu1b1lv1:active, a.menu1b2lv1:hover, a.menu1b2lv1:active { font-weight : bold; } The HTML for this is: Code: <div id="menu1main"> <div class="menu1" onmouseover="this.className='display'" onmouseout="this.className='menu1'"> <a class="menu1b1lv1" href="">Intro</a> <div class="menu1list"> <a class="menu1lv2" href="">Part 1 Title</a> <a class="menu1lv2" href="">Part 2 Title</a> <a class="menu1lv2" href="">Part 3 Title</a> </div></div> <div class="menu1" onmouseover="this.className='display'" onmouseout="this.className='menu1'"> <a class="menu1b2lv1" href="">Chapter 1</a> <div class="menu1list"> <a class="menu1lv2" href="">Part 1 Long Title</a> <a class="menu1lv2" href="">Part 2 Long Title</a> <a class="menu1lv2" href="">Part 3 Long Title</a> </div></div> </div> The problem with this version is I can't change the width of the submenu, or else the second Chapter title will float to the right. So I tried the second method: PHP Code: ul.top { /* Top drop down menu styles */ display : block; padding : 0; margin : 0; border : none; font-family : Comic Sans MS; font-size : 10pt; text-align : center; vertical-align : middle; } #topnav li.topnav0 { /* Top drop down top level menu styles */ position : relative; float : left; background-image : url('image/menu_banner_1.jpg'); background-position : 50% 0% ; background-repeat : no-repeat; width : 110px; line-height : 31px; } #topnav li.topnav0 a { /* Top level link styles */ color : #000000; text-decoration : none; } li.topnav0 a:hover { /* Top level hover styles */ text-decoration : none; font-weight : bold; } #topnav ul.topnav1 a:hover { /* Drop down hover styles */ text-decoration : none; background-image : url('image/menu_cube_1.gif'); background-position : 0 50% ; background-repeat : no-repeat; } li.topnav0 ul.topnav1 {/* Drop down box style */ display : none; background : #FFFFFF; padding : 0; margin : 0; position : absolute; top : 100%; left : 0; } #topnav ul.topnav1 a { /* Drop Down Submenu Item Styles */ display : block; padding : 0; margin : 0; text-indent : 16px; text-align : left; font-size : 8pt; line-height : 20px; width : 250px; } #topnav li.topnav0:hover ul.topnav1, li.over ul.topnav1, li.over li.topnav1 { /* Makes Drop down work in IE */ display : block; } And the HTML is as follow: Code: <div> <ul class="top" id="topnav"> <li class="topnav0"><div><a href="#">Home</a></div> </li> <li class="topnav0"><div><a href="#">Intro</a></div> <ul class="topnav1"> <li><a href="#">Part 1 Title</a></li> <li><a href="#">Part 2 Title</a></li> <li><a href="#">Part 3 Title</a></li> </ul> </li> <li class="topnav0"><div><a href="#">Chapter 1</a></div> <ul class="topnav1"> <li><a href="#">Part 1 Long Title</a></li> <li><a href="#">Part 2 Long Title</a></li> <li><a href="#">Part 3 Long Title</a></li> </ul> </li> </ul> </div> The problem with this version is that I cannot change the background image for each Chapter on the top level. Also, I cannot make the background of the drop down submenu transparent. If I make it transparent or delete the background line, the Part 2 link will not show up. Any help of making either method to work is great appreciated! Thank you very much! Hello, In my menu, I'm trying to center the first level of the List Items, and left justify the second level of the List Items. So the Menu will be centered and the pop-up links will be left justified. I know it's probably super simple, but for some reason, I'm missing it! Quote: /*!!!!!!!!!!! Menu Core CSS !!!!!!!!!!!!!*/ .qmmc .qmdivider{display:block;font-size:1px;border-width:0px;border-style:solid;position:relative;z-index:10000;} .qmmc .qmdividery{float:left;width:0px;} .qmmc .qmtitle{display:block;cursor:default;white-space:nowrap;position:relative;z-index:10000;} .qmclear {font-size:1px;height:0px;width:0px;clear:left;line-height:0px;display:block;float:none !important;} .qmmc {position:relative;zoom:1;z-index:10000;} .qmmc a, .qmmc li {float:left;display:block;white-space:nowrap;position:relative;z-index:10000;} .qmmc div a, .qmmc ul a, .qmmc ul li {float:none;} .qmsh div a {float:left;} .qmmc div{visibility:hidden;position:absolute;} .qmmc .qmcbox{cursor:default;display:block;position:relative;z-index:10000;} .qmmc .qmcbox a{display:inline;} .qmmc .qmcbox div{float:none;position:static;visibility:inherit;left:auto;} .qmmc li {z-index:10000;} .qmmc ul {left:-10000px;position:absolute;z-index:10000;} .qmmc, .qmmc ul {list-style:none;padding:0px;margin:0px;} .qmmc li a {float:none} .qmmc li:hover>ul{left:auto;}#qm0 ul {top:100%;}#qm0 ul li:hover>ul{top:0px;left:100%;} I am working on a website for a client and I am having trouble following A List Apart's tutorial (I can't link yet). I have a working css dropdown menu using a css sprite. But what I am trying to do, is when you mouse over a dropdown and go down the dropdown, that the parent menu remains at it's hover state. Currently what is happening is as soon as I mouseout of the parent level it goes back to the normal state. I don't really want to post the link to the test site itself if I don't have to for client privacy. Please help! I'm getting way too frustrated now, I've look at so many examples and nothing seems to work. I don't even need the javascript, I just need it to work. I've experimented with javascript and without. This is the code I am using: javascript: Code: <script type="text/javascript"> <!-- startList = function() { if (document.all&&document.getElementById) { menuRoot = document.getElementById("menu"); for (i=0; i<menuRoot.childNodes.length; i++) { node = menuRoot.childNodes[i]; if (node.nodeName=="LI") { node.onmouseover=function() { this.className+=" over"; } node.onmouseout=function() { this.className=this.className.replace(" over", ""); } } } } } window.onload=startList; //-> </script> HTML Markup: Code: <div id="nav"> <ul id="menu"> <li><a href="index.php" class="home"></a></li> <li><a href="link" class="tour"></a></li> <li><a href="link" class="events"></a> <ul class="drop"> <li><a href="/events/calendar">Calendar</a></li> <li><a href="/events">Ag Science Hall of Fame</a></li> <li><a href="/events/tastes">TASTES</a></li> </ul> </li> <li><a href="news" class="news">News</a> <ul class="drop"> <li><a href="link">Legislation</a></li> <li><a href="news/latest-news">Latest News</a></li> <li><a href="/news/newsletter">Newsletter</a></li> <li><a href="news/in-the-media">In the Media</a></li> </ul> </li> <li><a href="link"></a></li> <li><a href="link"></a></li> </ul> </div> Menu CSS: Code: #nav { position: relative; float:left; width:940px; height:35px; z-index: 9; background: #fff; } #menu, #menu ul { position: relative; padding:0; margin:0; clear:both; float:left; width:455px; z-index: 9; } #menu ul.drop { background:#520006; /* padding:10px;*/ width:inherit; clear:both; float:left; margin-top:35px; z-index: 9; } #menu ul.drop li { width: 130px; clear:both; padding: 5px; z-index: 9; } #menu ul.drop li:hover { background: #c10101; z-index: 9; } #menu ul.drop a { color:#fff; font-size:11px; text-decoration:none; font-weight:normal; clear:both; float:left; z-index: 9; } #menu a { display: block; /*width: 10em;*/ float:left; clear:both; width:130px; } #menu li { float: left; /*width: 10em;*/ } #menu li ul { position: absolute; width: 10em; left: -999em; z-index: 9; } #menu li:hover ul { left: auto; } #menu li:hover ul, #menu li.sfhover ul { left: auto;} /*SPRITE BACKGROUP POSITIONING*/ #menu li a.home, #menu li a.tour, #menu li a.events, #menu li a.news, #menu li a.donate, #menu li a.involved, #menu li a.resources, #menu li a.about, #menu li a.contact { float:left; background:url('images/menu.jpg') no-repeat; height:35px; text-indent:-999999px; } #menu li a.home:hover, #menu li a.home.over {background-position: 0px -35px;} #menu li a.home {width: 62px;} #menu li a.tour:hover {background-position: -62px -35px;} #menu li a.tour {width: 63px; background-position: -62px 0px;} #menu li a.events:hover, #menu li a.events.hover {background-position: -125px -35px;} #menu li a.events {width: 101px; background-position: -125px 0px;} #menu li a.news:hover {background-position: -226px -35px;} #menu li a.news {width: 80px; background-position: -226px 0px;} #menu li a.donate:hover {background-position: -306px -35px;} #menu li a.donate {width: 75px; background-position: -306px 0px;} #menu li a.involved:hover {background-position: -381px -35px;} #menu li a.involved {width: 74px; background-position: -381px 0px;} ul {list-style: none;} I'm beginning to suspect that this just isn't possible without javascript, but I'm throwing it out here just in-case I get lucky. Basically, what I want is a square-div that is no more than 90% of the window-height or 90% of the window-width, and will scale to fit the smaller of the two sizes. So, say the viewable area of the page is 800 x 600, the div would scale to be 540 by 540. If the size were 400 x 500, then it would be 360 by 360. I know that of course it's trivial to do with fixed-width divs by specifying a size in pixels, but is there any-way to do it for anything else? Images work nicely, as they will try to remain at the same aspect-ratio when stretched. I'm trying to make a nice simple interface composed of a few large, elements, that is able to scale seamlessly from desktop to mobile screen-sizes. There are very few things which are just impossible to do using HTML and CSS, but I'm wondering if I've finally hit something that is. First, some background: I'm trying to do some code for a wordpress image gallery on my blog. I have a plugin that allows me to code the gallery however I want, so that's not a problem. However, I'm redesigning my site, and I want to keep both galleries I have already posted and new galleries that I'm going to post to all look the same. The problem is this: the old galleries all have 2 images in a row, while the new ones will have 3 images in a row (and perhaps even 4 in some situations). All images in any given gallery will have the same heights and widths, but height and width of images between galleries can change. What I've been trying to accomplish is the following: A box, which creates a border around the entire gallery. Images stack horizontally as wide as they can go on the page, then drop down to the next line. As I said, sometimes this will be 2 and sometimes 3 images. However, the border should always be "skin tight" (give or take a few pixels of padding) around the gallery. I've tried just about every combination of tags, floating, and display options, and nothing seems to work. Either the containing element is either full width of it's container (if container is display block or inline-block with no width) constrains the widths of the images (if it does have a width), or the box doesn't fully contain the top row of images (if the container is display inline with non-floated content). I can usually either get the right width, but not the right height, or the right height, but not the right width. Getting both the right height and width appear to be the problem. As of right now, my code for the gallery looks something like the following (it is ever changing, so it's kind of pointless to post what it is at this exact moment): Code: <div class="outer"> <span class="inner"><a href="whatever"><img /></a></span> <span class="inner"><a href="whatever"><img /></a></span> <span class="inner"><a href="whatever"><img /></a></span> <span class="inner"><a href="whatever"><img /></a></span> <span class="inner"><a href="whatever"><img /></a></span> <span class="inner"><a href="whatever"><img /></a></span> <span class="inner"><a href="whatever"><img /></a></span> <span class="inner"><a href="whatever"><img /></a></span> <span class="inner"><a href="whatever"><img /></a></span> </div> However, I'm just running out of ideas, and I'm about ready to either say "screw the look of the old galleries" or use wordpress's built in options for how many rows there are (the problem with this is I have to set it for each gallery - something that I'm trying to avoid if possible, as resorting to that also presents issues with galleries I've already posted) Hi! I'm working on a design for an art gallery client that calls for a primary image of variable width with static alignment to the right and bottom, with a row of thumbnails below that align with the left edge of the image. This is working fine in FF and Chrome, but I can't seem to get IE to constrain the containing div by the image width. The thumbnails, floated left, go all the way to the edge of the layout... I've tried different combinations of positioning on the containing div (you can see the comments in my CSS), but can't seem to get it to go. The URL in question is here . Any help would be mightily appreciated! -BBD Hey guys, I'm having trouble with the cellpadding on a "tab" on my page. I've got a div that has a table with a single cell inside it. The table is left justified in the div and has a black background. I can't give the table cell a fixed width because a word of variable length will appear inside it. The text in the cell appears aligned center and valigned middle, with 10 pixels of padding on the left and right sides. This appears exactly right in every browser but IE 6 on Windows, where the left and right padding is lost, and the word is bumped right up to the edge of the black table cell. How can I fix this? Thanks a lot. Here's the page: http://aoi2.keysandwings.com/about.php Here's the HTML: Code: <div class="relativetitle""> <table class="titletable"> <tr> <td align="center" valign="middle">About</td> </tr> </table> </div> And here's the CSS: Code: .relativetitle { position: relative; margin-left: auto; margin-right: auto; z-index: 1; width: 682px; height: 30px; color: white; background: transparent; font-size: larger; text-align: left } .titletable { height: 100%; padding-left: 10px; padding-right: 10px; background: black } I have a titlebar for an article for my site and i'm trying to achieve rounded corners with transparency. The problem is that my transparent images (toprightcorner and blobs) are showing the background of the div i've used to tile the background image across the bar (it's variable width). How can I prevent this? i know there is background-position but i need a fixed size that the background won't tile across at either end while the width is variable. Is the only solution to make 3 divs and use 2 as columns to hold the corner images and have the background tile across it or is there an easier way? Here is the relevant code Thanks --James Code: <div class="articlebox"> <div class="articletitle"><img class="left" src="blobs.jpg" border="0" /></div> </div> css Code: Original - css Code div.articlebox{ width:100%; /*attach it to the top of the box so we can layer the corner on top of it*/ background:rgb(249,249,249) url('topbg2.png') repeat-x fixed; padding:0px; margin:0px; } div.articletitle{ text-align:left; width:100%; height:21px; background:url('toprightcorner2.png') no-repeat right top; border-bottom:1px solid #888; padding:0px; margin:0px; } div.articletitle img{ float:left; } * html div.articletitle img{ margin-left:-3px; }
I'm trying to make up a thumbnail page that shows pics in a row at a constant height. I don't want the images distorted so the width will vary. I tried: Code: img.proj_thumb {border-style:none; height:75px; width:auto} Ths worked on mylaptop, but fails on the server - see the attached pics. Any suggestions? Something for the css pros: Can anybody give me a hint on how to convert the following (table) based markup snippet to div-only markup? http://www.twosailors.net/test.html In all my tests I cannot get the rightmost cell expand so the whole menu gets it's total size. I do NOT want to convert the boxes to fixed width but keep them shrinkwrapping around the menu texts. Also, I do want a border around the boxes so any faking with background colors will not work either. Any ideas? Andreas Pardeike Hi, Can anyone help me. I am using a son of suckerfish dropdown menu on a joomla 1.5 site I am working on. laminatefabricators.com The menu is dropping down fine on all of my browsers (apple mac: safari, camino, firefox). & are fine on firefox for pc. The menus aren't displaying at all on Internet explorer. Please help... I have wasted so much time trying to fix it/find a fix. Hi, I have hit the "wall" in my knowledge of CSS while trying to implement a "flex-width-equal-height-sidebar-layout" style of layout as a skin/theme for a message board system and need some help. My trouble occurs when a direct link to the post is used (instead of following the menu navigation system) where the top menu information/links area (the area between the banner and the post) is chopped off... The relevant portion of the CSS seems to be the .col_wrap {margin-top: 10px; border: 0; overflow: hidden; float: left; width: 100%; position: relative; z-index: 10; clear: both;} portion of my CSS because if I take out the overflow:hidden declaration then the menu portion of the skin/theme/layout shows correctly but the sidebar the shows the part which should be hidden at the bottom and the footer completely vanishes from view! My apologies but this is the best I can do without having the ability to post pics or urls which could better explain what is wrong and frankly speaking I don't know how anyone here can help given my inability to show the problem but hopefully someone knows or has run into this problem before or can offer some resources that may be of assistance.... i ve been playing with my page and been trying to modify the width of the page (divs) according to the browswer's width. The problem is i want the navigation menu on left to be fixed width (say 200px) and the center div and the right column to be variable width. Also, i want to set a minimum width , so that the floating divs dont roll below the navigation menu. here s the link to the page. try reducing ur browser windows size . the content div rolls down under theleft nav menu. http://ccc.1asphost.com/pacemakerpr...r/cicuitlab.htm Also , i get wierd result in netscape navigator. please help I have an absolutely positioned <div> containing a block of text. I have not specified a width for this <div>. This <div> is nested within another <div> for which I have specified a width of 200px. So something like: html4strict Code: Original - html4strict Code <div style="position: relative; width: 200px;"> <div style="position: absolute; top: 10px; left: 20px; z-index: 100;"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Curabitur eu purus a tellus mollis consequat. Phasellus aliquam sapien quis mauris. </div> </div> <div style="position: relative; width: 200px;"> Since the absolutely positioned <div> is not part of the page's normal flow, I would expect that its width would expand according to its contents (and the browser window's boundries). Instead, in Firefox only, the width of the absolutely positioned <div> expands only to the width of its parent - in this case 200px. Am I doing something wrong? or is there a workaround for this? So I tried this popular drop-down menu technique and is all good except that the second-level menu links line up beside the top-level headers in IE6 instead of, well, dropping down (which thankfully does happen in FF). This would be very confusing for visitors trying to navigate! I have seen this problem described on forums and blogs but not found a solution. The example page at HTML Dog displays properly in IE6, which offers no insights . . . See the page in question: hire.karenjeane.com/web/site2.php Thanks for any help! Hi, q1)I can't move the menu to the right without problems as i set a margin on #headlinks2 and the links get cluttered? Code: #headlinks2 { height:25px; } #headlinks2 a { color:green; display: block; text-decoration:none; width: 100px; font-size:13pt; padding-right:5px; //margin-left:205px; } #headlinks2 a:hover { color: white; } #headlinks2, #headlinks2 ul { padding: 0; margin: 0; list-style: none; } #headlinks2 li { float: left; width: 100px; } #headlinks2 li ul { position: absolute; width: 100px; left: -999em; } #headlinks2 li:hover ul { left: auto; } #headlinks2 li:hover ul, #headlinks2 li.sfhover ul { left: auto; } </style> <script type="text/javascript"> sfHover = function() { var sfEls = document.getElementById("nav").getElementsByTagName("LI"); for (var i=0; i<sfEls.length; i++) { sfEls[i].onmouseover=function() { this.className+=" sfhover"; } sfEls[i].onmouseout=function() { this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); } } } if (window.attachEvent) window.attachEvent("onload", sfHover); </script> //html <div id="headlinks2"> <li><a href="#">Percoidei</a> <ul> <li><a href="#">Remoras</a></li> <li><a href="#">Tilefishes</a></li> <li><a href="#">Bluefishes</a></li> </ul> </li> <li><a href="#">Anabant</a> <ul> <li><a href="#">Climbing perches</a></li> <li><a href="#">Labyrinthfishes</a></li> <li><a href="#">mex</a></li> </ul> </li> <li><a href="#">Percoidei</a> <ul> <li><a href="#">Remoras</a></li> <li><a href="#">Tilefishes</a></li> <li><a href="#">Bluefishes</a></li> </ul> </li> <li><a href="#">Anabant</a> <ul> <li><a href="#">Climbing perches</a></li> <li><a href="#">Labyrinthfishes</a></li> <li><a href="#">mex</a></li> </ul> </li> <li><a href="#">Percoidei</a> <ul> <li><a href="#">Remoras</a></li> <li><a href="#">Tilefishes</a></li> <li><a href="#">Bluefishes</a></li> </ul> </li> <!-- etc. --> </div> Hi everyone, So I'm implementing the suckerfish dropdown into one of my sites. I'm having a bit of trouble getting something to work correctly. I did most of the grunt work on getting it customized, but I was hoping someone could help me figure out a few minor details. The version of the drop down I had to make has images for the top level (main level) of the navigation, and each image is a unique size. In doing so, as well as adding padding to the second level li for aesthetic purposes, in IE the menu doesn't drop but floats over to the right. I'm not sure why this is. Also, I know this may be more fit for the JavaScript area, and I'll repost there if necessary, but I'd like to keep the top level image in the "over" state while the cursor is on that 2nd level dropdown. Is that possible? I'll be anxious for your feedback, this has been driving me crazy all day. Here's the code. XHTML: Code: <div id="nav"> <ul> <li class="one"><a href="#"><img src="images/home.gif" /></a></li> <li class="two"><a href="#" onmouseover="document.two.src='images/nav-our_products_on.gif';" onmouseout="document.two.src='images/nav-our_products_off.gif';"><img name="two" src="images/nav-our_products_off.gif" /></a> <ul> <li><a href="#">sublink 1</li></a> <li><a href="#">sublink 2</li></a> </ul> </li> </ul> </div> CSS Code: #nav { margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #67670f; } #nav ul { margin: 0; padding: 0; list-style: none; } #nav ul li.one { float: left; margin: 0; padding: 0; width: 51px; list-style: none; } #nav ul li.one img { border: 0; } #nav ul li.two { float: left; margin: 0; padding: 0; width: 118px; list-style: none; position: relative; } #nav ul li.two img { border: 0; } /* - begin level 2 - */ #nav ul li ul { margin: 0; padding: 0; list-style: none; position: absolute; left: -999em; border: solid 1px #ddd; width: 118px; voice-family: "\"}\""; voice-family:inherit; width: 116px; } #nav ul li ul li a { display: block; padding: 3px 0 3px 3px; margin: 0; color: #67670f; text-decoration: none; width: 118px; voice-family: "\"}\""; voice-family:inherit; width: 113px; } #nav ul li.two ul li a:hover { color: #52432c; background-color: #e4e2db; text-decoration: none; } #nav ul li:hover ul, #nav ul li.sfhover ul { left: auto; } JavaScript Code: sfHover = function() { var sfEls = document.getElementById("nav").getElementsByTagName("LI"); for (var i=0; i<sfEls.length; i++) { sfEls[i].onmouseover=function() { this.className+=" sfhover"; } sfEls[i].onmouseout=function() { this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); } } } if (window.attachEvent) window.attachEvent("onload", sfHover); It seems that in IE something isn't being cleared, as it almost appears that the second level is in place directly next to the top level link that is activating the dropdown menu. I look forward to your insight! Thanks! -Brian I'm working on my first suckerfish dropdown for a site. I'm encountering two problems. 1) There is no background color on the subitems when i select the main item, making them hard to read 2) Internet Explorer displays the dropdown to the right of the main list item, rather than below. Netscape displays it correctly. Is this due to something I altered? Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Markey Home Remodeling</title> <link href="main.css" rel="stylesheet" type="text/css"> <style title="text/css"> #container { width: 562px; background: #F4ECD9; text-align: left; margin: 0 auto; } #nav, #nav ul { float: left; width: 562px; list-style: none; line-height: 1; background: EAE3A3; font-weight: bold; padding: 0; margin: 0 0 1em 0; } #nav a { display: inline; width: 10em; w\idth: 6em; color: #7C6240; text-decoration: none; padding: 0.25em 2em; } #nav a.daddy { background: url(rightarrow2.gif) center right no-repeat; } #nav li { float: right; padding: 0; width: 10em; } #nav li ul { position: absolute; left: -999em; height: auto; width: 14.4em; w\idth: 13.9em; font-weight: normal; border-width: 0.25em; margin: 0; } #nav li li { padding-right: 1em; width: 13em } #nav li ul a { width: 13em; w\idth: 9em; } #nav li ul ul { margin: -1.75em 0 0 14em; } #nav li:hover ul ul, #nav li:hover ul ul ul, #nav li.sfhover ul ul, #nav li.sfhover ul ul ul { left: -999em; } #nav li:hover ul, #nav li li:hover ul, #nav li li li:hover ul, #nav li.sfhover ul, #nav li li.sfhover ul, #nav li li li.sfhover ul { left: auto; } #nav li:hover, #nav li.sfhover { background: white; } </style> <script type="text/javascript"> sfHover = function() { var sfEls = document.getElementById("nav").getElementsByTagName("LI"); for (var i=0; i<sfEls.length; i++) { sfEls[i].onmouseover=function() { this.className+=" sfhover"; } sfEls[i].onmouseout=function() { this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); } } } if (window.attachEvent) window.attachEvent("onload", sfHover); </script> </head> <body> <table width="800" border="0" cellspacing="0" cellpadding="0" class="tableborder" align="center"> <tr> <td colspan="2"> </td> </tr> <tr> <td height="20" width="562" class="leftnav"> <div id="container"> <ul id="nav"> <li><a href="#">SIDING</a></li> <li><a href="#">GUTTERS</a></li> <li><a href="#">BASEMENTS</a></li> <li><a href="#">WINDOWS</a> <ul> <li><a href="#">300 Series</a></li> <li><a href="#">900 Series</a></li> <li><a href="#">Sliding</a></li> <li><a href="#">Bay and Bow</a></li> </ul> </li> <li><a href="#">DOORS</a> <ul> <li><a href="#">Entry</a></li> <li><a href="#">Patio</a></li> <li><a href="#">Garage</a></li> </ul> </li> </ul> </div></td> <td class="rightnav"> <div id=linkstyles> <a href="#">HOME</a> <a href="#">CONTACT US</a> </div></td></tr> <tr> <td> <table width="562" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="images/mainimage.jpg"></td> </tr> <tr> <td><div align="center"><img src="images/whychoose.jpg"></div></td> </tr> <tr><td> <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center" class="maincontenttable"> <tr> <td width="50%">REPUTATION: A proven track record with thousands of delighted customers. <br><br> QUALITY: The highest quality products, the best trained window installers *all A.W.D.I. (American Window and Door Installed) Certified. <br><br> PRICE: The lowest prices on the highest quality brand-name products. Period. <br><br> Factory Authorized Distribution, Factory Trained Employees. <br><br> Qualified, Courteous Salespeople treat you with professionalism and respect. </td> <td width="355"> </td> </tr> </table> </td></tr> </table> </td> <td valign="top" width="100%" class="mainrighttable"> <table width="230" border="0" cellspacing="0" cellpadding="0" align="left"> <tr> <td><img src="images/pledge.jpg" hspace="5" vspace="5"></td> </tr> <tr> <td> <table border="0" cellspacing="0" cellpadding="0" align="right" class="rightcontenttable"> <tr> <td>Our business has always been family owned and operated. For more than 27 years, we have served our community with pride and integrity. Years ago, the best craftsmen always put their names on their work. <br><br> We still do.</td> </tr> </table> </td> </tr> <tr> <td> </td> </tr> </table> <span class="style1"></span></td> </tr> </table> </body> </html> Thanks for your help |