[SOLVED] Menu appearance different in IE8 & Firefox need a little help

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
elkman
Power Poster
Power Poster
Posts: 262
Joined: Thu Jan 11, 2007 9:16 pm

[SOLVED] Menu appearance different in IE8 & Firefox need a little help

Post by elkman »

I've tried to convert a one level menu into a multi-level menu by converting cssmenu.tpl to my new menu.  The menu box holding the children items appear to the right of the parent in IE8.  In Firefox, the menu dropdowns appear correctly but the last menu item is not aligned properly with the other parent menu items.  It appears lower, as if there is a margin space above it.

Any guidance will be greatly appreciated.

I am using 1.7.1 and will upgrade a bit later.  The active url is lifelongquilting.com

Below is the new menu template and menu CSS:

{* CSS classes used in this template:
#menuwrapper - The id for the that the menu is wrapped in. Sets the width, background etc. for the menu.
#primary-nav - The id for the
.menuparent - The class for each that has children.
.menuactive - The class for each that is active or is a parent (on any level) of a child that is active. *}
{if $count > 0}


{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string='' times=$node->depth-$node->prevdepth}
{elseif $node->depth prevdepth}
{repeat string='' times=$node->prevdepth-$node->depth}

{elseif $node->index > 0}
{/if}
{if $node->parent == true or ($node->current == true and $node->haschildren == true)}

current == true}

haschildren == true}

type == 'sectionheader' and $node->haschildren == true}
{$node->menutext}{elseif $node->type == 'separator'}
{else}

type != 'sectionheader' and $node->type != 'separator'}
{if $node->target}target="{$node->target}" {/if}
href="{$node->url}">{$node->menutext}
{elseif $node->type == 'sectionheader'}
>{$node->menutext}
{/if}
{/foreach}
{repeat string='' times=$node->depth-1}




{/if}

Below is the new menu CSS:

/* by Alexander Endresen and mark and Nuno */
#menu_vert {
/* no margin/padding so it fills the whole div */
margin: 0;
padding: 0;
}
.clearb {
/* needed for some browsers */
clear: both;
}
#menuwrapper{
/* set the background color for the menu here */
width: 1000px;
height: 46px;
background: url(uploads/fresh/images/img04a.jpg) no-repeat left top;

/* IE6 Hack */
height: 1%;
width: auto;
/* one border at the top */

}
ul#primary-nav, {
/* remove any default bullets */
margin: 0 auto;
padding: 0;

}
ul#primary-nav ul {
margin: 0;
padding: 0px 0px 0px 48px;
list-style: none;
line-height: normal;
}
ul#primary-nav ul ul {
/* now we move the next level ul down from the top a little for distinction */
margin-top: 1px;
/* pull it in on the left, helps us not lose the hover effect when going to next level */
margin-left: -1px;
/* keeps the left side of this ul on the right side of the one it came out of */
left: 100%;
/* sets the top of it inline with the li it came out of */
top: 0px;
}
ul#primary-nav li {
/* floating left will set menu items to line up left to right else they will stack top to bottom */
float: left;
}
#primary-nav li li {
/* Set the width of the menu elements at second level. Leaving first level flexible. */
width: 140px;
/* removes any left margin it may have picked up from the first li */
margin-left: 0px;
/* keeps them tight to the one above, no missed hovers */
margin-top: -1px;
/* removes the left float set in first li so these will stack from top down */
float: none;
/* relative to the ul they are in */
position: relative;
}
/* set the "a" link look here */
ul#primary-nav li a {
display: block;
height: 32px;
margin-right: 3px;
padding: 14px 30px 0px 30px;
text-decoration: none;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: normal;
color: #FFFFFF;
border: none;
text-decoration: none;
}
ul#primary-nav li a:hover {
/* kind of obvious */
background-color: transparent;
}
ul#primary-nav li li a:hover {
background: #B883B7;
text-decoration: underline;
}
/*ul#primary-nav li a.menuactive {background: #B883B7;}*/
ul#primary-nav li a.menuactive:hover {
background: #B883B7;
}
#primary-nav li li a.menuparent span {
/* makes it hold a shape */
display: block;
}
/* gif for IE6, as it can't handle transparent png */
* html #primary-nav li li a.menuparent span {
/* set your image here, right arrow, 98% over from the left, 100% or 'right' puts it to far */
background: #B883B7;
}
ul#primary-nav li ul a {
/* insures alignment */
text-align: left;
margin: 0px;
/* keeps it relative to it's container */
position: relative;
/* less padding than first level no need for large links here */
padding: 6px 3px 6px 15px;
/* if first level is set to bold this will reset this level */
font-weight: normal;
/* first level is #FFF/white, we need black to contrast with light background */
color: #FFFFFF;
border: none;
}
ul#primary-nav li ul {
/* very lite grey color, by now you should know what the rest mean */
background: #B883B7;
margin: 0px;
padding: 0px;
position: absolute;
width: auto;
height: auto;
display: none;
position: absolute;
z-index: 999;
}
ul#primary-nav li ul ul {
/*Info: The opacity property is  CSS3, however, will be valid just in CSS 3.1) http://jigsaw.w3.org/css-validator2) More Options chose CSS3 3) is full validate;)*/
opacity: 95;
/* CSS 3 */
}
/* Styling the appearance of menu items on hover */
#primary-nav li:hover {
background: #B883B7
}
#primary-nav li.menuh,
#primary-nav li.menuparenth,
#primary-nav li.menuactiveh {
background: #722602
}
/* The magic - set to work for up to a 3 level menu, but can be increased unlimited, for fourth level add
#primary-nav li:hover ul ul ul,
#primary-nav li.menuparenth ul ul ul,
*/
#primary-nav ul,
#primary-nav li:hover ul,
#primary-nav li:hover ul ul,
#primary-nav li.menuparenth ul,
#primary-nav li.menuparenth ul ul {
display: none;
}
/* for fourth level add
#primary-nav ul ul ul li:hover ul,
#primary-nav ul ul ul li.menuparenth ul,
*/
#primary-nav li:hover ul,
#primary-nav ul li:hover ul,
#primary-nav ul ul li:hover ul,
#primary-nav li.menuparenth ul,
#primary-nav ul li.menuparenth ul,
#primary-nav ul ul li.menuparenth ul {
display: block;
}
/* IE6 Hacks */
#primary-nav li li {
float: left;
clear: both;
}
#primary-nav li li a {
height: 1%;
}
Last edited by elkman on Sat Sep 25, 2010 5:13 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Menu appearance different in IE8 & Firefox need a little help

Post by Dr.CSS »

It looks fine in my IE8, but you may want to check it in a validator as your running into a few problems, you have h2 with /h3 closing tag and a few extra calls...

As far as the menu problem, you have the search set at a certain height and if you change it to 100px instead of 110px it will fix it, here really isn't any reason to give it a fixed height...
elkman
Power Poster
Power Poster
Posts: 262
Joined: Thu Jan 11, 2007 9:16 pm

Re: Menu appearance different in IE8 & Firefox need a little help

Post by elkman »

Thanks for your input.  Adjusting the search height fixed the menu location problem in Firefox.  Cleaning up the H1 and H2 tags and removing the two extra divs didn't affect the menu problem in IE8.

However, viewing the same website under a different user ID on the same computer showed the menu appeared perfectly in IE8.  Gotta love Microsoft.  Has this happened to anyone else? 

I would love to figure out why this would occur and save myself the time looking for something that seems to be wrong but isn't.

Thank you for looking Dr. CSS!
Post Reply

Return to “Layout and Design (CSS & HTML)”