CSS - Css Hover Menu Box Not Positioning Identically In Ie & Firefox
Hi all, haven't had to post for awhile. Need some help!
Am trying to create a popup box below menu when hovering over link, strictly using CSS. My problem is everything's working perfect in IE(a rarity), but in Firefox the box pops up too high and is wider than I want Here's the code... CSS: Code: body { margin: 0; padding: 0; background: url(bodybg.jpg) repeat-x #000; } #header { position: absolute; top: 0; left: 0; width: 100%; height: 100px; background: url(metalpipe2.png) bottom repeat-x; margin: 0; padding: 0; } #leftcontent { position: absolute; top: 110px; left: 0; width: 125px; height: 700px; margin-left: 15px; padding: 0; } /*moved background to #leftcontent a. Can now create transparent gap for background to show between links.*/ #leftcontent a { display: block; margin: 0; padding: 5px; font-weight: bold; font-size: 17px; background: #222; color: #C00; font-family: Arial; text-align: center; text-decoration: none; } #leftcontent a:hover { color: lightgrey; border: none; } /*had to add border: none; to make span box work in IE*/ #leftcontent a span { display: none; } #leftcontent a:hover span { display: block; position: absolute; top: 255px; left: 0; width: 135px; margin-left: -5px; padding: 5px; background: #000; color: lightgrey; font-size: 12px; border: 1px solid white; } #midcontent { position: absolute; top: 110; left: 155px; right: 25px; height: 700px; margin: 0; padding: 0; background: #F5F5F5; } #midcontent p { margin: 0; padding: 20px; } HTML: Code: <html> <head> <title>Test Page</title> <link rel="stylesheet" href="TestPage.css" type="text/css" media="screen" /> <style type="text/css"> <!-- #leftcontent a#link1 { color: #C00; background: #444; border: none; padding: 5px; } --> </style> </head> <body> <div id="header"> <img src="x-fire_logo_t4.png" alt="X-Fire logo" /> </div> <!-- end #header --> <div id="leftcontent"> <a href="link" id="link1">Home</a> <a href="link" id="link2">Home Fire Sprinklers<span>Text for<br />a:hover span { }<br />popup window</span></a> <a href="link" id="link3">Fire Alarm Systems</a> <a href="link" id="link4">Burglar Alarm Systems</a> <a href="link" id="link5">Insurance<br /> Info.</a> <a href="link" id="link6">Contact Us</a> </div> <!-- end #leftcontent --> <div id="midcontent"> <p>Here's my dilema. Hover over Home Fire Sprinklers link. There should be a popup window below menu.<br />Popup location & width looks great in IE.<br />But in Firefox it pops up higher & wider than I wish. </p> <p>Could someone tell me what I'm overlooking?...Many Thanks!</p> <p>Got idea from <a href="http://www.meyerweb.com/eric/css/edge/popups/demo.html">Eric Meyer's site</a>. His page doesn't encounter this problem and I can't see anything special in the source that's much different from mine.</p> </div> <!-- end #midcontent --> </body> </html> Many Thanks, James Similar TutorialsHellO~! I'm current trying to code a website for someone, but I'm having some problems getting the menu to work properly in Firefox. It works great in Chrome and Safari but I have no idea how to make it work properly for firefox. So basically, I have a drop line menu, but instead the sub links all showing up in the same spot when I hover, I want the sub links to show up under the link I'm hovering over. Now, I managed to get this working great by just changing the position of the sub ul and il hover to relative. URL But in Firefox, when you hover over a link, that link expands to the width of the sub navigation and pushes the other links to the right. It just looks terrible and I don't know how to fix this. URL I've tried searching for a solution, but no luck! I'd really appreciate if someone could enlighten me on how this could be fixed? Or if it's even possible? I'm still new to working with drop downs and would love the help! Advance thanks for those who read this! Hopefully someone can help me out with this! EDIT: Looks like my images wont show up after all . Hopefully you will all know what I mean. CSS CODE: Code: * { margin:0; padding:0; } #nav { list-style:none; position:relative; } #nav li { float:left; text-align:center; } #nav a { display:block; text-decoration:none; } #nav a:active, #nav a:focus, #nav a:hover { background:#254563; } /* --------- Sub Nav --------- */ #nav li.current ul { left:0px; } #nav ul { position:absolute; left:-999em; list-style:none; padding:0 0 0; width: 500px; } #nav ul li { width: auto; margin: 3px 3px 0 0px; } #nav ul a { font-size: 12px; height: auto; padding: 5px 10px; background: #dfeec9; border-radius: 8px; -moz-border-radius: 8px; width: auto; } #nav li:active ul, #nav li:hover ul { height: 30px; left: 10px; position: relative; padding: 0px 3px 5px 3px; background: none; width: 500px; } .navi01 { display: block; padding-top: 0px; padding-left: 0px; width: 33px; height: 44px; text-decoration: none; background: url(images/navi_01.png); } .navi02 { display: block; padding-top: 0px; padding-left: 0px; width: 133px; height: 44px; text-decoration: none; background: url(images/navi_02.png); } .navi03 { display: block; padding-top: 0px; padding-left: 0px; width: 86px; height: 44px; text-decoration: none; background: url(images/navi_03.png); } .navi04 { display: block; padding-top: 0px; padding-left: 0px; width: 83px; height: 44px; text-decoration: none; background: url(images/navi_04.png); } .navi05 { display: block; padding-top: 0px; padding-left: 0px; width: 92px; height: 44px; text-decoration: none; background: url(images/navi_05.png); } .navi06 { display: block; padding-top: 0px; padding-left: 0px; width: 82px; height: 44px; text-decoration: none; background: url(images/navi_06.png); } .navi07 { display: block; padding-top: 0px; padding-left: 0px; width: 30px; height: 44px; text-decoration: none; background: url(images/navi_07.png); } HTML NAV CODE: Code: <ul id="nav"> <li><span class="navi01"> </span></li> <li><a href="originalart/gallery.php"><span class="navi02"> </span></a> <ul> <li><a href="originalart/gallery.php">Original Art</a></li> <li><a href="fanart/gallery_fanart.php">Fan Art </a></li> <li><a href="commissions/gallery_commissions.php">Commissions</a></li> <li><a href="roughwork/gallery_roughwork.php">Rough Work</a></li> </ul> </li> <li><a href=""><span class="navi03"> </span></a> <ul> <li><a href="info.php">Info</a></li> <li><a href="http://luisarafidi.deviantart.com/journal/11831940/">FAQ </a></li> </ul> </li> <li><a href="oldartwork/gallery_oldartwork.php"><span class="navi04"> </span></a></li> <li><a href="http://blog.luisarafidi.com/"><span class="navi05"> </span></a> <ul> <li><a href="#">Old Artwork</a></li> <li><a href="#">More</a></li> </ul> </li> <li><a href=""><span class="navi06"> </span></a></li> <li><span class="navi07"> </span></li> </ul> I am a photographer for a website and I know very little about anything other than basic html. With the website lady gone on a trip around the world for a year, I ended up being the person to attempt to modify our side menu to show an additional column of subcategories. I tinkered around with the code we had and I managed to get this to work in Firefox, however in IE7 the contents of the menu shift down a few pixels when you hover over a category. To view my problem, go to scannerparts.biz I've messed around with this for a few days and everything has become a big confusing mess so I have no choice but give in and ask for help. I thank anyone in advance for any assistance you can offer. -Emerson Here is the code: hover.css Code: <!-- body { behavior: url(/images/csshover2.htc); } div#categorynav ul {margin: 0px; padding: 0px;} .submenu { position: relative; margin: 0px; padding: 2px 0px; width: 178px; } div#categorynav ul.level1 li a { position: relative; display: block; text-decoration: none; margin: 0px; padding: 0px; } div#categorynav ul.level2 li { position: relative; display: block; text-decoration: none; margin: 0px; padding: 0px; } div#categorynav ul.level3 li { position: relative; display: block; text-decoration: none; margin: 0px; padding: 0px; } div#categorynav ul.level1 ul.level2 a { background-color: #000000; color: #fff; width: 178px; font-weight:normal; padding: 4px 4px 4px 14px; } div#categorynav ul.level2 ul.level3 a { background-color: #000000; color: #fff; width: 178px; font-weight:normal; padding: 4px 4px 4px 14px; } html>body div#categorynav ul.level1 ul.level2 a { width: auto; padding: 0px; margin: 0px; } html>body div#categorynav ul.level2 ul.level3 a { width: auto; padding: 0px; margin: 0px; } div#categorynav>ul a {width:auto; padding: 0px; margin: 0px;} div#categorynav ul ul {position: absolute; display: none; width: 100px; z-index:900; padding: 0px; margin: 0px;} div#categorynav ul ul li {padding: 0px; margin: 0px;} div#categorynav ul.level1 li.submenu:hover ul.level2 { display: block; list-style-image: none; list-style-type: none; } div#categorynav ul.level2 li.submenu:hover ul.level3 { display: block; list-style-image: none; list-style-type: none; } div#categorynav ul.level2 { top: 0px; left: 178px; margin: 0px; padding: 0px; width:160px; } div#categorynav ul.level2 li a:hover { background-color: #000000; color: red; } div#categorynav ul.level3 { top: 0px; left: 178px; margin: 0px; padding: 0px; width:160px; } div#categorynav ul.level3 li a:hover { background-color: #000000; color: red; } Abbreviated Header Source (abbreviated for max character requirement, I think I left all the vital stuff there) Code: <!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <ss:comment><link href="hover.css" type="text/css" rel="stylesheet" media="screen"/></ss:comment> <link href="$store.images['hover.css']" type="text/css" rel="stylesheet" media="screen"/> <style type="text/css"> <!-- /* Style Sheet */ body { margin-top: 10px; margin-right: 0px; margin-bottom: 30px; margin-left: 1px; background-image: url(/images/backgroundgray.jpg); background-repeat: repeat-x; background-position: center bottom; } html { height: 100%; margin-bottom: 1px; } #outline{ border :0px solid #ffffff; width :760px; } #categories{ background-color:#000000; color:#ffffff; text-decoration:none; text-align : left; display: block; padding : 5px 5px 1px 0px; font-weight :bold; font-size:9pt; font-family:<ss:value source=$font.paragraph.face/>; width :178px; padding: 0px; } #cat1{ background-color:#000000; color: #ffffff; text-decoration:none; text-align: left; display: block; font-weight :normal; font-size: 9pt; font-family:<ss:value source=$font.paragraph.face/>; width: 178px; padding: 0px; } #cat1 a{ background-color:#000000; color: #ffffff; text-decoration:none; text-align: left; display: block; font-weight: normal; font-size:9pt; font-family:<ss:value source=$font.paragraph.face/>; width :178px; padding: 0px; } #cat1 a:hover{ background-color:#000000; color:#ff0000; text-decoration:none; text-align : left; display: block; font-weight: normal; font-size:9pt; font-family:<ss:value source=$font.paragraph.face/>; width :178px; padding: 0px; } .leftnav { background-color:#000000; color:#ffffff; text-decoration:none; font-weight :bold; font-size:9pt; font-family:<ss:value source=$font.paragraph.face/>; padding : 2px 5px 1px 0px; } .leftnav A:link { background-color:#000000; border-bottom : 1px solid #666666; color:#ffffff; text-decoration:none; text-align : left; display: block; padding : 2px 5px 1px 0px; font-weight :bold; } .leftnav A:visited { background-color:#000000; border-bottom : 1px solid #666666; color:#ffffff; text-decoration:none; text-align : left; display: block; padding : 2px 5px 1px 0px; font-weight :bold; } .leftnav A:hover { background-color:#000000; border-bottom : 1px solid #666666; color:#ff0000; text-decoration:none; text-align : left; display: block; padding : 2px 5px 1px 0px; font-weight :bold; } .leftnav A:active { background-color:#000000; border-bottom : 1px solid #666666; color:#ffffff; text-decoration:none; text-align : left; display: block; padding : 2px 5px 1px 0px; font-weight :bold; } A:link {text-decoration:underline;color:<ss:value source=$font.paragraph.color/>;} A:visited {text-decoration:underline;color:<ss:value source=$font.paragraph.color/>;} A:hover {text-decoration:none;color:<ss:value source=$font.paragraph.color/>;} A:active {text-decoration:underline;color:<ss:value source=$font.paragraph.color/>;} .content {font-family:<ss:value source=$font.paragraph.face/> ;color:<ss:value source=$font.paragraph.color/>;} .title {font-size:10pt;font-weight:bold;font-family:<ss:value source=$font.paragraph.face/> ;color:#ffffff;} .footer {font-size:9pt;font-family:<ss:value source=$font.paragraph.face/> ;color:<ss:value source=$font.paragraph.color/>;} --> </style> </head> <body> <center> <div id="outline"> <table width="760" border="0" cellspacing="0" cellpadding="0"> <!-- banner image --> <tr valign="top"><td colspan="4"><a href="(URL address blocked: See forum rules)"><ss:image source="$templateSet.images['header.jpg']" border="0"/></a></td></tr> <tr valign="top"> <!-- left nav --> <td bgcolor="#000000"> </td> <td width="175" bgcolor="#000000"> <div class="leftnav"> <!-- store logo --> </div> <div class="leftnav"> <div style="border-bottom : 0px solid #666666;"> </div> <!-- home --> </div> <!-- categories --> <p><font face="Arial,Helvetica,sans-serif" size="2" color="white"><b>Parts and Products:</b></font></p> <div id="categorynav"> <div id="categories"> <ul class="level1"> <ss:foreach item="category" within="$catalog.categoryList()"> <ss:sortby item="categorypriority" direction="asc"/> <ss:if test="$category.treeLevel == '1'"> <ss:set name="hasSub" value="0"/> <ss:foreach item="subcategory" within="$category.childrenToDepth(1)"> <ss:set name="hasSub" value="1"/> </ss:foreach> <li class="submenu"> <div id="cat1"><ss:link source="$category"/></div> <ss:if test="$hasSub == '1'"> <ul class="level2"> <ss:foreach item="subcategory" within="$category.childrenToDepth(1)"> <ss:sortby item="categorypriority" direction="asc"/> <ss:if test="$category.treeLevel == '2'"> <ss:set name="hasSub" value="1"/> <ss:foreach item="subcategory" within="$category.childrenToDepth(1)"> <ss:set name="hasSub" value="1"/></ss:foreach></ss:if> </li> <li class="submenu"> <div id="cat1"><ss:link source="$subcategory"/></div> <ss:if test="$hasSub == '1'"> <ul class="level3"> <ss:foreach item="subcategory" within="$subcategory.childrenToDepth(1)"> <li><ss:link source="$subcategory" title="$subcategory.name"/></li> </ss:foreach> </ul> </ss:if> </ss:foreach> </ul> </ss:if></ss:foreach> </li> </ss:if></ss:if></ss:foreach> <br> </ul> </div> </div> I am desperate. I think I found a bug in Firefox, and I'm not sure how to work around it. The following code works in everything (IE 8, Chrome, Safari, Opera) except Firefox (version 3.6.3). Am I doing something wrong, or is this a bug in Firefox? You can look what happens to the drop-down menu's on Menu 2 and 3 live by going to my site (deenfoxx dot com slash firefox-bug dot html). css Code: Original - css Code #main-nav { background-color: black; height: 40px; } #nav { position: relative; margin: 0; padding: 0; } #nav li { position: relative; float: left; display: table; width: 99px; height: 40px; border-right: 1px solid white; text-align: center; font-size: 10px; } #nav li:hover { background-color: darkred; } #nav a { display: table-cell; vertical-align: middle; line-height: 11px; font-weight: bold; text-decoration: none; color: #fff; } #nav li ul { position: absolute; padding: 0; background-color: gray; top: 40px; left: 0px; } #nav li ul li { width: 98px; border: 0; border-top: 1px solid white; } #main-nav html4strict Code: Original - html4strict Code <div id="main-nav"> <ul id="nav"> <li id="m1"><a href="#1">Main Menu 1</a></li> <li> <a href="#2">Main Menu 2</a> <ul> <li><a href="#2a">Sub-Category 1</a></li> <li><a href="#2b">Sub-Category<br/>with multiple lines</a></li> </ul> </li> <li> <a href="#3">Main Menu 3 with multiple lines</a> <ul> <li><a href="#3a">Sub-Category 2</a></li> </ul> </li> <li><a href="#4">Main Menu item which has a really long name on it</a></li> </ul> </div> <div id="main-nav"> The problem appears to be that "#nav li" happens to have position:relative; and a display:table; and "#nav li ul" is position:absolute;. Normally, absolute positioning requires its parent or ancestor position to be set, but when used with the table display, it doesn't work normally on Firefox--but it does on other browsers. Can someone help me with a workaround that does not involve altering the HTML? If I must, I will accept a workaround that requires changing the HTML, but I'll have to do some heavy duty recoding of Magento's core menu generation. Anyone that knows Magento knows I want to avoid that like the plague--my example is a very simplified version of the problem. Hello 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 Problem here - view in IE6 Relative CSS Hello! This is quite an odd one. In IE6, there's a problem whereby upon hovering over the category / product links, the position of elements will shift a small amount. This is the best I can explain the issue really. There are no positioning changes attributed to the .hover pseudo-element on either class. I have a feeling it has something to do with margins, but am at a loss trying to find the solution. Any help rewarded with a glacier cherry, some sugar and 44 gleaming rep points Hi All, I'm pretty confused by this. Work ins IE6 but not in Firefox 1.0.4 I've uploaded the offending page below... http://www.bertucci.net/nwhc/index2.php I moved the relavent CSS into the HTML and commented out the linking sheets. The problem... at seemingly random places the hover properties do not work. On hover, the link should be underlined. Some links will work right, while others do not. I've done many googles and a Dev Shed search with no answers so far, so I'm making a post here for help. The page is a mix of DIV and TABLE elements. I just think it's easier for me to work with. A Side question, is this an 'ok' practice or should sites be designed strictly DIV or TABLE only? (All styles for DIVs are right in the DIV I have not broken them out yet until the design is hammered down). Cheers, Fozzy Hi, I have the following CSS: .class2 a:hover {text-decoration: none; background-color: #333366; color: #ffffff; width: 100%; height: 100%; font-weight: bold;} for this javascript/HTML: menu1[0]='<span class="class2"><a href=""> About our trees</a></span><br>' It's part of a drop down menu and in IE when a user hovers over the About our trees, the entire box is highlighted with my chosen color. In Firefox, only the text in the box is highlighted. Can someone help me with this one? I tried switching from a <span> to a <div> and still no good. AAUGH. Happy Thanksgiving to all who are celebrating! Kimber When you hover over Contact Us/info the menu that drops down by the way i'm using the pixo plugin for that the words end up being seen through the tab.. and the news thing that scrolls that is using the plugin Announcement and vertical scroll news How do you fix that? This is a problem in Firefox, IE etc.. is the url mcshanesnursery dot com can please someone tell me why the code below does not work. and please explain how do I make it work. Code: <style> a.home { width: 63px; height:47px; padding:0px 0px 0px 0px; background: url(http://refinethetaste.com/html/themes/default/images/btn_header_home_off.gif) no-repeat; } a.home:hover { background: url(http://refinethetaste.com/html/themes/default/images/btn_header_home_on.gif) no-repeat; } a.myaccount { width: 100px; height:47px; padding:0px 0px 0px 0px; background: url(http://refinethetaste.com/html/themes/default/images/btn_header_myaccount_off.gif); } a.myaccount:hover { background: url(http://refinethetaste.com/html/themes/default/images/btn_header_myaccount_on.gif); } </style> <a href="#" class="home"></a> <a href="#" class="myaccount"></a> Im novice to CSS, im makin my first one. I have this problem, i made my class and then i did the a:hover with that class but it is not shown in firefox and opera, works fine in IE. Am i forgetting something? how do i fix? here's my code: Code: body { background-color: #1A1852; background-image: url(../imagenes/fondo2.gif); } .menu { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; color: #000000; text-decoration: none; } a:menu:link { text-decoration: none; } a:menu:active { text-decoration: none; } a:menu:visited { text-decoration: none; color: #000000; } a:menu:hover { font-weight: bold; text-decoration: none; color: #000000; } .actual { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; color: #000000; font-weight: bold; text-decoration: underline; } .descarga { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; color: #FFFFCC; text-decoration: none; } a.descarga:hover { font-weight: bold; text-decoration: underline; color: #FF9966; } .texto { color: #FFFFFF; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; } .pie { font-family: Verdana, Arial, Helvetica, sans-serif; color: #CCCCCC; font-size: 10px; } .titulo { color: #CC66CC; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; font-weight: bold; } .vinculo { color: #FFFFFF; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; color: #FFFFCC; } .tabla { border-style: dashed; border-width: thin; border-color:#CC66CC; } Hey, Just making a site for a friend and I have run into a block with the Hover tag. It works fine in IE but for some reason other browsers aren't working properly... Any ideas? I have put my source underneath, sorry its squashed up. I have also loaded the site to the domain but won't put the link - not sure if I'm allowed. 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> <title>Innovate Photography - Home</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="StyleSheet" href="style.css" type="text/css" media="screen" /> </head> <body> <div id="wrap"> <div id="header"> <img src="images/logo2.png" alt="logo - Innovate photography" width="780" height="62" /> </div> <ul id="nav_bar"> <li><b href="index.html">Home</b></li> <li><a href="about.html">About Us</a></li> <li><a href="gallery.html">Gallery</a></li> <li><a href="disability.html">Disability</a></li> </ul> <div id="slideshow"> <img src="images/index_page/1.jpg" alt="Slideshow Image 1" class="active" /> <img src="Images/index_page/2.jpg" alt="Slideshow Image 2"/> <img src="Images/index_page/3.jpg" alt="Slideshow Image 3"/> <img src="Images/index_page/4.jpg" alt="Slideshow Image 3"/> </div> <!--Java image gallery - Index Page --> <script type="text/javascript" src="jquery-1.2.6.min.js"></script> <script type="text/javascript"> /*** Simple jQuery Slideshow Script Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc. Please link out to me if you like it :) ***/ function slideSwitch() { var $active = $('#slideshow IMG.active'); if ( $active.length == 0 ) $active = $('#slideshow IMG:last'); // use this to pull the images in the order they appear in the markup var $next = $active.next().length ? $active.next() : $('#slideshow IMG:first'); var $sibs = $active.siblings(); var rndNum = Math.floor(Math.random() * $sibs.length ); var $next = $( $sibs[ rndNum ] ); $active.addClass('last-active'); $next.css({opacity: 0.0}) .addClass('active') .animate({opacity: 1.0}, 1000, function() { $active.removeClass('active last-active'); }); } $(function() { setInterval( "slideSwitch()", 5000 ); }); </script> <div id="content"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut et mi magna, non sodales augue. Aliquam porta, risus id euismod egestas, lacus velit tincidunt quam, in sodales enim urna et dui. Duis interdum libero at dolor aliquet nec ultricies lacus interdum. Proin non consequat erat. Sed varius, libero id bibendum aliquam, arcu augue ultrices dui, placerat laoreet dolor nibh et nunc. Ut dui magna, semper quis sagittis sed, faucibus ac ante. Nulla imperdiet tempor orci vel varius. Aliquam porta placerat tortor, non dignissim libero elementum ac. Mauris in magna in ligula tincidunt viverra non vestibulum elit. Etiam hendrerit leo non mauris consectetur nec blandit orci auctor. Sed felis felis, facilisis nec posuere ac, accumsan nec est. Aenean sapien magna, commodo ut sagittis gravida, varius eget magna. Etiam ligula sem, faucibus eget tristique quis, hendrerit vitae justo. Maecenas fermentum sollicitudin sodales. Ut non aliquet neque. Mauris sagittis gravida purus nec consequat. Sed in quam leo.</p> <p>Phasellus quis orci ligula. Curabitur quis neque ultricies ante adipiscing vehicula. Morbi blandit, purus dictum pharetra feugiat, magna ipsum lobortis velit, eu blandit turpis ipsum at arcu. Vestibulum non mauris felis. Curabitur viverra arcu eget tortor pellentesque a laoreet mauris mattis. Sed et ligula tortor, eget laoreet mauris. Integer nunc enim, tristique eu tempus at, vehicula non enim. Maecenas sed porttitor lorem. Nam ultricies, nisl rutrum vulputate facilisis, enim purus commodo elit, sed pretium tortor ligula quis lectus. Aliquam erat volutpat. Duis euismod placerat nisi ac adipiscing. Fusce varius pellentesque sapien, eu placerat neque mattis pharetra. Aenean mollis neque sed mi pretium sodales. Aenean fringilla rhoncus tincidunt. Sed vel odio et sem condimentum iaculis.</p> <p>In mollis posuere tortor, at euismod sem fermentum nec. Aenean euismod, neque sit amet tincidunt mattis, risus nunc bibendum mi, non malesuada purus eros ut urna. Donec accumsan sagittis nibh, auctor ultricies massa tincidunt et. Phasellus quam nunc, pretium eu dictum at, porttitor a dolor. Etiam nec odio felis, nec aliquam nibh. Sed eleifend, odio faucibus venenatis vulputate, orci neque mattis augue, sed consectetur tellus lorem a lacus. Aliquam diam ipsum, consectetur et tempus non, suscipit nec orci. Donec dignissim lobortis gravida. Integer ornare diam vitae elit tristique a auctor lorem condimentum. Sed sapien nisi, ullamcorper at gravida vitae, mollis vel mauris. In non tortor ante, nec scelerisque elit. Etiam tristique, magna quis tristique ultrices, nunc tellus tempus lorem, a suscipit tortor magna at dui.</p> </div> </div> </body> </html> Code: /* Index Markup */ * { padding: 0px; margin: 0px; } body { background-color: #ffffff; margin:0; padding:0; border:0; min-width:700px; font-size:100%; } #wrap { width:750px; margin:0 auto; padding-top: 20px; } #header {width: 200px; padding-left: 0px;} #nav { margin:0 auto; font:Palatino; } #nav_bar { width: 100%; float: left; margin: 0 0 3em 0; padding: 0; list-style: none; font:Palatino; padding-left: 190px; } #nav_bar li { float: left;} #nav_bar li a { display: block; padding: 8px 15px; text-decoration: none; font-weight: bold; color: #069; border-right: 1px dotted #000; font:Palatino; } #nav_bar li b {display: block; padding: 8px 15px; text-decoration: none; font-weight: bold; color: #069; border-right: 1px dotted #000; font:Palatino; border-left: 1px dotted #000; } #nav_bar a:hover {color: #000;} #nav_bar b:hover {color: #000;} #nav_bar:hover {color: #000;} h2 { font:Palatino; font-size:15px; text-decoration: none; } /*** Slideshow positioning **/ #slideshow { position:relative; width: 570px; height: 400px; padding-bottom: 10px; } #slideshow IMG { position:absolute; top:55px; right: -40px; z-index:10; } #slideshow IMG.active { z-index:10; opacity:1.0; } #slideshow IMG.last-active { z-index:9; } #content { position: relative; width: 670px; padding-top: 20px; font:Palatino; font-size:12px; color: #1e54ef; padding-bottom: 20px; padding-left: 30px; } #photo { } #index_style { position:absolute; left:50px; top:150px;} #index_button { position:absolute; left:750px; top:400px; } #index_button a { font-size: 30px; font:Palatino; } #index_button a:hover {color: #1e54ef} #index_button a:link {text-decoration: none; font-family:Georgia,serif;} Hi there, I'm using a css navigation hover effect that's loosely based on this mark-up: http://css.maxdesign.com.au/listamatic/horizontal23.htm This works fine in opera 8, ie and reasonably well in firefox; but there's a 1 second delay on the firefox hover. I've used this before with success. Not really understanding why/how this could be happening. I should mention I'm using the AlphaImageLoader on an unrelated part of the page. Anyone else have this problem? Possible solutions? Thanks. H. Long title I know... My problem is that I want a particular style for a link BUT it seems that Firefox has a glitch with it. The css code is: Code: a, a:link, a:visited { color: #000; text-decoration: none; border-bottom: 2px solid #000; } a:hover { color: #28f; border-bottom: 0; } Basically Firefox starts "flashing" the cursor simply just by hovering over the link. It only does this if you hover over the "line" part of the link. Here's an image of what it looks like: You can view this yourself on the page http://www.jasonashdown.co.uk/css_glitch.html I did however find a way around it with css code: Code: a:hover { color: #28f; border-bottom: 2px solid transparent; } http://www.jasonashdown.co.uk/css_glitch_solution.html This works fine in Firefox and Opera without displaying the glitch. BUT now IE won't accept it (putting a Doctype in the file seems to make the bottom-border disappear). Can anybody explain to me why Firefox has this glitch? I couldn't find anything about this problem on this forum or through google. It has been bothering me for months. Many Thanks in advance Okay so the site is pawnsuppliesdirect.com it works flawlessly on mozilla, and IE7, but on IE6 the spacing is messed up and the hover links don't show the flyout part of the menu. Below is the css for the menu and it does validate: @charset "utf-8"; /* CSS Document */ /* common styling */ .menu {font-family: arial, sans-serif; width:100px; height:100px; position:relative; margin:0; font-size:10px; margin:5px 5px 60px 5px;} .menu ul li a, .menu ul li a:visited {display:block; text-decoration:none; color:#FFFFFF; width:90px; height:20px; border-left:1px solid #5fb7dd; text-align:left; background:#000000; line-height:19px; font-size:11px; padding-left:10px;} .menu ul {padding:0; margin:0; background-color:#000000;list-style-type: none;} .menu ul li {float:left; margin-right:1px; position:relative;} .menu ul li ul {display: none;} /* specific to non IE browsers */ .menu ul li:hover a {color:#fff; background:#5fb7dd;} .menu ul li:hover ul {display:block; position:absolute; top:0; left:101px;} .menu ul li:hover ul li a.hide {background:#000000; color:#FFFFFF;} .menu ul li:hover ul li:hover a.hide {width:100px;} .menu ul li:hover ul li ul {display: none;} .menu ul li:hover ul li a {display:block; background:url(../img/transparent.gif); color:#ffffff; width:100px; border-right:1px solid #5fb7dd;} .menu ul li:hover ul li a:hover {background:#5fb7dd; color:#fff;} .menu ul li:hover ul li:hover ul {display:block; position:absolute; left:140px; top:0; color:#ffffff;} .menu ul li:hover ul li:hover ul li a {display:block; width:100px; background:#5fb7dd; color:#ffffff;} .menu ul li:hover ul li:hover ul li a:hover {background:#5fb7dd; color:#fff;} any suggestions? My nav menu works 100% in IE8, FF, Opera and Chrome... but it's doing something weird in IE7 that can kindof affect it's functionality but I have no idea really where to look for the problem. It's most easily seen on two pages. The front page, he http://www.skullcrow.com ...and on the product pages he http://www.skullcrow.com/proddisp.php?id=skull01 On the main page when you hover over the menu and get the drop downs, if you move your cursor so you're also over the text div in the background, the menu goes away. You can tell easiest when viewing the "Community" and "Help" lists. On the product display page is the same thing over a larger area. Anytime you move the cursor to a part of the menu that's covering the text or (only some of?) the background div, it disappears. The menu is obviously on top, and this problem does not occur in basically any other browser. The main reason I need to fix this is that these menus will probably only get bigger and the navbar will become barely unusable in IE7 after a while. I don't exactly what code I would need to post for this, I was just hoping for some general information that could point me in the right direction. Thanks for any help. Hi, I've been at this for some time now. Currently building a site (development address: mainline.divsharp.com). Menu (left) was Javascript, its now CSS. Works fine in Chrome, Firefox and IE 8, but IE 7 is acting extremely strange. You can see the desired effect if you use a recent version of one of those browsers. When I pull it up in IE 7 on the homepage, I can't hover over the popup like I can in the other, more compliant browsers. It either hides the pane as soon as the mouse gets off the main menu link, or when the mouse leaves the picture once its over the pane. If I then click on, say, "Market Watch" and try to view the menu on an interior page, its even more erratic. I'm about at the end of what I know or can look up how to do here.. If I can get the mouse over some part of the popout pane, it seems that if its over the content area of a div and not padding or margins, it stays open. For example, over the picture or over the grey area to the right... This might suggest something to someone.. Unfortunately, the markup is clogged at best and my style is all over the place. Site is built in Wordpress and is a custom theme. Hopefully this will help: Home page style sheet: mainline.divsharp.com/wp-content/themes/mainline/style.css Interior page style sheet: mainline.divsharp.com/wp-content/themes/mainline/interior.css In those stylesheets, there isn't much discernible organization, but the pieces relating to this problem are near the id's labeled menu_bg in the middle and at the very bottom is where the hover effects are. The popout is achieved like this: Code: <li id="popout_hov"> <div id="popout">code for menu pane</div> </li> #popout_hov #popout { visibility: none; } #popout_hov:hover #popout { visibility: visible; } Thanks. Hello, I'm trying to create a menu for my NGO to replace the one they have currently but I'm running into some problems. The highlight color in this photo is one - how do you get around this issue? I'd like to keep the colors the same, if possible, but I recognize that might not be acceptable. the menu img is at kburke - org slash menuhover.jpg Thanks! here's the code: /*** DEMO SKIN ***/ .sf-menu { float: left; margin-bottom: 1em; font:11px Verdana, sans-serif; font-weight:bold; } .sf-menu a { border-left: 1px solid #fff; border-top: 1px solid #CFDEFF; padding: .75em 1em; text-decoration:none; color: #FFFFFF; } .sf-menu a, .sf-menu a:visited { /* visited pseudo selector so IE6 applies text colour*/ color: #ffffff; } .sf-menu li { background: #b6791e; } .sf-menu li ul li a { color: #769841; } .sf-menu li li a:active, .sf-menu li li a:focus { color: #ffffff; } .sf-menu li li { background: #ffffff; } .sf-menu li li li { background: #ffffff; } .sf-menu li:hover, .sf-menu li.sfHover, .sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active { background: #769841; outline: 0; color: #FFFFFF; } /*** arrows **/ .sf-menu a.sf-with-ul { padding-right: 2.25em; min-width: 1px; /* trigger IE7 hasLayout so spans position accurately */ } .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*/ } Hi, I'm trying to set up my (very basic, horizontal, no dropdown) CSS menu so that when a user hovers over the menu link items, the formatting changes and they basically get an image on mouseover (nothing more than changing the text colour and adding a curve on the left hand side, so it just looks like a selected tab). It kind of works but instead of the whole image showing it only shows in the area where the menu link text is, so instead of covering the height of the menu bar and a length I specify, it's just covering the actual word e.g "Home" in each case on the menu. I can't seem to get it so that on rollover the whole image shows. I've tried setting it so that the links have a background image (just a plain block from the nav bar) but that doesn't work. My CSS is: /* this is the bar where the menu is located */ .menuholder { width:1001px; height:2.19em; background-color:#0f2763; } /*holder for the menu */ div.navigation { margin-left:30px; padding-top:10px; } .navigation ul { list-style-type: none; position: relative; float: left; } .navigation ul li { display: block; padding: 0px 20px 0px 10px; display: inline; height:2.19em; } .navigation ul li a { font-family:Arial, Helvetica, sans-serif; color:#FFF; font-size:14px; font-weight:bold; line-height:18px; width:100px; height:2.19em; text-decoration:none; } .navigation ul li a:hover { color:#0f2763; background-image:url(/images/menutab.gif); width:100px; height:2.19em; } I've tried setting display:block; and float:left; on the .navigation ul li, but this makes the menu become vertical and throws the whole page out of sync. I tried this altrnative code, to no avail: .menuholder { width:1001px; height:2.19em; background-color:#0f2763; } div.navigation { margin-left:30px; padding-top:10px; height:2.19em; } .navigation ul { list-style-type: none; position: relative; float: left; } .navigation ul li { padding: 0px 20px 0px 10px; display: block; float:left; height:2.19em; } .navigation ul li:hover { color:#0f2763; background-image:url(/images/menutab.gif); width:100px; height:2.19em; background-repeat:no-repeat; } .navigation ul li a { font-family:Arial, Helvetica, sans-serif; color:#FFF; font-size:14px; font-weight:bold; line-height:18px; width:100px; height:2.19em; text-decoration:none; display: inline; } Any ideas or pointers gratefully received! I had to make a hover menu that was full CSS, and i couldn't make it work in IE, because of the old issue of IE not supporting :hover for anything else but the a tag. So i modded some example i found on the internet that was using js for ie, attached through behaviours, in the css file. The url is this. The menu works fine in mozilla but it has a problem in IE, and i think it's css, not js. If you hover over the Products button and then over one of the items that appear, the item right under it will get a few pixels higer, which causes the whole menu to move down as you movewr over those ites. And it's annoying. Can some one give me a hint please? I've tried all sorts of things, adding empty level 3 menus to the items that don't need it, but still nothing... Thanks in advance... Hiya, Hoping for a bit of help with a menu I've made. Basically it's a tabbed menu with another line underneath for an explanation of what you'll find if you click on the tab. The explanation shows up when you hover over the appropriate tab. I also have an 'active' class that highlights whatever section you're on and shows that explanation as default. It all works fine until you're halfway through the menu, and the explanations won't show for any menu item previous to the active one. I know this is something to do with z-index, but I can't for the life of me figure out where to put it. Can anyone help? This is only happening in IE. Full Code he Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Menu Problem</title> <link href="menu.css" rel="stylesheet" type="text/css" /> <!-- The line below starts the conditional comment --> <!--[if IE]> <style type="text/css"> body {behavior: url(csshover.htc);} </style> <![endif]--> <!-- This ends the conditional comment --> </head> <body> <div class="container"> <p>First Active Tab:</p> <div class="nav"> <ul> <li class="active"><a href="#" title="Item 1"><span>Item 1</span></a> <ul class="item1"> <li><span>Caption for Item 1. Caption for Item 1. </span></li> </ul> </li> <li><a href="#" title="Item 2"><span>Item 2</span></a> <ul class="item2"> <li><span>Caption for Item 2. Caption for Item 2. </span></li> </ul> </li> <li><a href="#" title="Item 3"><span>Item 3</span></a> <ul class="item3"> <li><span>Caption for Item 3. Caption for Item 3. Caption for Item 3. </span></li> </ul> </li> <li><a href="#" title="Item 4"><span>Item 4</span></a> <ul class="item4"> <li><span>Caption for Item 4. Caption for Item 4. </span></li> </ul> </li> <li><a href="#" title="Item 5"><span>Item 5</span></a> <ul class="item5"> <li><span>Caption for Item 5. Caption for Item 5. </span></li> </ul> </li> <li><a href="#" title="Item 6"><span>Item 6</span></a> <ul class="item6"> <li><span>Caption for Item 6. Caption for Item 6.</span></li> </ul> </li> </ul> </div> <!-- End nav --> <p style="margin-top: 20px; padding-top: 20px; border-top: 1px solid #000;">Middle Active Tab:</p> <div class="nav"> <ul> <li><a href="#" title="Item 1"><span>Item 1</span></a> <ul class="item1"> <li><span>Caption for Item 1. Caption for Item 1. </span></li> </ul> </li> <li><a href="#" title="Item 2"><span>Item 2</span></a> <ul class="item2"> <li><span>Caption for Item 2. Caption for Item 2. </span></li> </ul> </li> <li><a href="#" title="Item 3"><span>Item 3</span></a> <ul class="item3"> <li><span>Caption for Item 3. Caption for Item 3. Caption for Item 3. </span></li> </ul> </li> <li class="active"><a href="#" title="Item 4"><span>Item 4</span></a> <ul class="item4"> <li><span>Caption for Item 4. Caption for Item 4. </span></li> </ul> </li> <li><a href="#" title="Item 5"><span>Item 5</span></a> <ul class="item5"> <li><span>Caption for Item 5. Caption for Item 5. </span></li> </ul> </li> <li><a href="#" title="Item 6"><span>Item 6</span></a> <ul class="item6"> <li><span>Caption for Item 6. Caption for Item 6.</span></li> </ul> </li> </ul> </div> <!-- End nav --> </div> </body> </html> CSS He Code: /* CSS Document */ body{margin: auto; text-align: center; background: #fff; font-size: 80%;} .container{ margin: auto; padding-top: 6px; width: 1000px; text-align: left; background: #fff;} /* Main Menu */ .container .nav{background: #fff; height:68px; line-height:34px;left:0px; font-weight: bold; font-family: Arial, Helvetica, sans-serif; color: #fff; text-transform:uppercase;margin-left: 6px; } .container .nav ul{list-style: none; position:relative;} .container .nav ul li{display: inline; float: left; position:relative; font-size: 0.9em; } .container .nav ul li a{text-decoration:none; color:#fff; background: #A90100; padding-left: 20px; } .container .nav ul li a, .container #nav ul li a span{ display: block; float: left;} /* Hide from IE5-Mac \*/ .container .nav a, .container .nav a span{float: none} .container .nav ul li a:hover{text-decoration:none; color:#fff; background: #351405; } .container .nav ul li.active a{text-decoration:none; color:#fff; background: #351405; } .container .nav ul li.active a span{text-decoration:none; color:#fff; background: #351405; } .container .nav ul li.active ul{display: block;} .container .nav ul li a span{background: #A90100; padding-right: 20px; } .container .nav ul li a:hover span{text-decoration:none; color:#fff; background: #351405; } .container .container .nav li > ul {top: auto;left:auto;} .container .nav ul li ul{ display:none; position: absolute; width: 700px; left: 0px; top: 0px; float: left; font-family:Arial, Helvetica, sans-serif; font-size: 12px; text-transform:none; font-weight: normal;} .container .nav ul li:hover ul{ z-index:100;} .container .nav ul li ul.item1{ left: 10px; z-index: 0;} .container .nav ul li ul.item2{ left: -67px; z-index: 0;} .container .nav ul li ul.item3{ left: -144px; z-index: 0;} .container .nav ul li ul.item4{ left: -221px; z-index: 0;} .container .nav ul li ul.item5{ left: -298px; z-index: 0;} .container .nav ul li ul.item6{ left: -375px; z-index: 0;} .container .nav ul li:hover ul.item1{z-index: 100;} .container .nav ul li:hover ul.item2{z-index: 100;} .container .nav ul li:hover ul.item3{z-index: 100;} .container .nav ul li:hover ul.item4{z-index: 100;} .container .nav ul li:hover ul.item5{z-index: 100;} .container .nav ul li:hover ul.item6{z-index: 100;} .container .nav ul li ul li{ display:inline; position: absolute; float: left; left:10px; top: 39px; height: 24px; line-height: 24px; width: 700px; float: left; color: #fff; font-family:Arial, Helvetica, sans-serif; font-size: 1em; text-transform:none; font-weight: normal; background: #351405;} .container .nav ul li:hover ul {display: block;} |