[Solved] Problem with my horizontal menu

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
Pépou
Forum Members
Forum Members
Posts: 24
Joined: Sat Aug 02, 2008 6:08 pm

[Solved] Problem with my horizontal menu

Post by Pépou »

I've got a little problem with my horizontal menu, the "accueil" box doesn't become orange on roll over. I've tested many many things, but i didn't find the way to solve this problem.

My web site : www.nice-anatomie.fr

Here is my css sheet of the menu :
/* Horizontal menu for the CMS CSS Menu Module */
/* by Alexander Endresen */

#menu_vert {
   margin-left: 1px;
   margin-right: 1px;
   font-size: 9pt
}

/* The wrapper clears the floating elements of the menu */

/* Fix for Opera 8 */
.clearb { clear: both; }
#menuwrapper {
   /* Fix for Opera 8 */
   /*   overflow: hidden;  */
   background: #46461F url(uploads/TerraFirma/a16.gif) repeat-x;
   border-bottom: 0px solid #C0C0C0;
   width: 100%;
}

/* Set the width of the menu elements at second level. Leaving first level flexible. */
#primary-nav li li {
   width: 200px;
   z-index: 100;
}

/* Unless you know what you do, do not touch this */
#primary-nav, #primary-nav ul {
   list-style: none;
   margin: 134px 0px 20px 0px;
   padding: 0px 20px 0px 0px;
}
#primary-nav ul {
   position: absolute;
   top: 42px;
   display: none;
}
#primary-nav ul ul {
   margin-top: 1px;
   margin-left: -1px;
   left: 100%;
   top: 0px;
}

#primary-nav li {
   margin-left: -1px;
   float: left;
}
#primary-nav li li {
   margin-left: 0px;
   margin-top: -1px;
   float: none;
   position: relative;
}

/* Styling the basic apperance of the menu elements */
#primary-nav a {
   display: block;
   margin: 0px;
   padding: 5px 10px;
   text-decoration: none;
   color: #FFFFFF;
}
#primary-nav li a {
   border-right: 1px solid #C0C0C0;
   border-left: 1px solid #C0C0C0;
}
#primary-nav li li a {
   border: -21px solid #C0C0C0;
}
#primary-nav li, #primary-nav li.menuparent {
   background: #46461F url(uploads/TerraFirma/a16.gif) repeat-x;
}

/* Styling the basic apperance of the active page elements (shows what page in the menu is being displayed) */

#primary-nav li.menuactive {
   background: #46461F url(uploads/TerraFirma/a16.gif) repeat-x;
}


/* Styling the basic apperance of the menuparents - here styled the same on hover (fixes IE bug) */
#primary-nav ul li.menuparent,
#primary-nav ul li.menuparent:hover,
#primary-nav ul li.menuparenth {
/* arrow for menuparents */
   background-image: url(images/cms/arrow.gif);
   background-position: center right;
   background-repeat: no-repeat;
}


/* Styling the apperance of menu items on hover */

#primary-nav li:hover,
#primary-nav li.menuh,
#primary-nav li.menuparenth,
#primary-nav li.menuactiveh {
   background: #ff7800;
}


/* The magic - set to work for up to a 3 level menu, but can be increased unlimited */

/*
just add
#primary-nav li:hover ul ul,
#primary-nav li.menuparenth ul ul ul,
for fourth level
*/
#primary-nav ul,
#primary-nav li:hover ul,
#primary-nav li:hover ul ul,
#primary-nav li:hover ul ul ul,
#primary-nav li:hover ul ul ul ul,   
#primary-nav li.menuparenth ul,
#primary-nav li.menuparenth ul ul {
   display: none;
}
#primary-nav li.menuparenth ul ul ul {
   display: none;
}
#primary-nav li.menuparenth ul ul ul ul {
   display: none;
}

/* add
#primary-nav ul ul ul li:hover ul,
#primary-nav ul ul ul li.menuparenth ul,
for fourth level
*/
#primary-nav li:hover ul,
#primary-nav ul li:hover ul,
#primary-nav ul ul li:hover ul,
#primary-nav ul ul ul li:hover ul,
#primary-nav ul ul 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;
}
#primary-nav ul ul ul li.menuparenth ul {
   display: block;
}
#primary-nav ul ul ul ul li.menuparenth ul {
   display: block;
}

/* IE Hacks */
#primary-nav li li {
   float: left;
   clear: both;
}
#primary-nav li li a {
   height: 1%;
}
Do you have any idear ??

Thank you in advance.
Last edited by Pépou on Wed Aug 06, 2008 10:34 am, edited 1 time in total.
sn3p
Forum Members
Forum Members
Posts: 169
Joined: Mon Oct 15, 2007 2:27 pm

Re: Problem with my horizontal menu

Post by sn3p »

The problem is caused by the image in the left, which is overlapping the menu. Try increasing the z-index for the menu.

Code: Select all

#menu_vert {
   margin-left: 1px;
   margin-right: 1px;
   font-size: 9pt;
   z-index: 4;
}
FYI, the menu doesn't work very well in IE6/7.
Pépou
Forum Members
Forum Members
Posts: 24
Joined: Sat Aug 02, 2008 6:08 pm

Re: Problem with my horizontal menu

Post by Pépou »

Thank you for your advice. Unfortunately, the z-index doesn't solve the problem..
sn3p
Forum Members
Forum Members
Posts: 169
Joined: Mon Oct 15, 2007 2:27 pm

Re: Problem with my horizontal menu

Post by sn3p »

Forgot to say, z-index only works for positioned elements (eg. position: relative;).
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Problem with my horizontal menu

Post by Dr.CSS »

You mean what color, orange is which #?...

primary-nav a:hover {your style}
sn3p
Forum Members
Forum Members
Posts: 169
Joined: Mon Oct 15, 2007 2:27 pm

Re: Problem with my horizontal menu

Post by sn3p »

Try adding position: relative; to the links.

Code: Select all

#primary-nav a { 
   display: block; 
   margin: 0px; 
   padding: 5px 10px; 
   text-decoration: none; 
   color: #FFFFFF;
   position: relative;
}
Pépou
Forum Members
Forum Members
Posts: 24
Joined: Sat Aug 02, 2008 6:08 pm

Re: Problem with my horizontal menu

Post by Pépou »

mark wrote: You mean what color, orange is which #?...

primary-nav a:hover {your style}
Orange is this color : #ff7800
Pépou
Forum Members
Forum Members
Posts: 24
Joined: Sat Aug 02, 2008 6:08 pm

Re: Problem with my horizontal menu

Post by Pépou »

sn3p wrote: Try adding position: relative; to the links.

Code: Select all

#primary-nav a { 
   display: block; 
   margin: 0px; 
   padding: 5px 10px; 
   text-decoration: none; 
   color: #FFFFFF;
   position: relative;
}
Thank you very much, that worked !!
Post Reply

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