[SOLVED] - Display "CSSMenu - Horizontal" SubMenus Horizontally

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
darinsee
Forum Members
Forum Members
Posts: 13
Joined: Sat Sep 08, 2007 10:24 pm

[SOLVED] - Display "CSSMenu - Horizontal" SubMenus Horizontally

Post by darinsee »

Hello,

I am using CMSMS 1.5.2 "Caugas" and PHP 5.2.3 and MySQL 5.0.67

I'm trying to get the submenus from the default "CSSMenu - Horizontal" stylesheet, to display horizontally (instead of vertically) - but try as I might, I can't get it to work - can anyone advise?

Thank You!

P.S.   - > Here is an example of a menu that works the way that I'm trying to replicate: http://www.lwis.net/free-css-drop-down- ... inear.html

P.P.S. - > Here is the unmodified CSSMenu:

Code: Select all

        /* Horizontal menu for the CMS CSS Menu Module */
        /* by Alexander Endresen */

        #menu_vert {
           margin-left: 1px;
           margin-right: 1px;
        }

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

        /* Fix for Opera 8 */
        .clearb { clear: both; }
        #menuwrapper { 
           /* Fix for Opera 8 */ 
           /*   overflow: hidden;  */ 
           background-color: #ECECEC;
           border-bottom: 1px solid #C0C0C0;
           width: 100%;
        }

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


        /* Unless you know what you do, do not touch this */ 
        #primary-nav, #primary-nav ul { 
           list-style: none; 
           margin: 0px; 
           padding: 0px; 
        }
        #primary-nav ul { 
           position: absolute; 
           top: auto; 
           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: #006699;
        }
        #primary-nav li a { 
           border-right: 1px solid #C0C0C0;
           border-left: 1px solid #C0C0C0;
        }
        #primary-nav li li a { 
           border: 1px solid #C0C0C0;
        }	
        #primary-nav li, #primary-nav li.menuparent { 
           background-color: #ececec; 
        }

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

        #primary-nav li.menuactive { 
           background-color: #C7C7C7; 
        }


        /* 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-color: #E7AB0B; 
        }


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


        /* IE Hacks */
        #primary-nav li li { 
           float: left; 
           clear: both; 
        }
        #primary-nav li li a { 
           height: 1%; 
        }
Last edited by darinsee on Tue Feb 17, 2009 1:44 pm, edited 1 time in total.
darinsee
Forum Members
Forum Members
Posts: 13
Joined: Sat Sep 08, 2007 10:24 pm

Re: Display "CSSMenu - Horizontal" SubMenus Horizontally

Post by darinsee »

As a note, what I've tried to do so far, is to change this block:

Code: Select all

        #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; 
        }
To this:

Code: Select all

        #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: inline;
        }
But that change doesn't do the trick.



I have also added this, but again to no avail:

Code: Select all

     
        #primary-nav li ul li 
        { 
           float: left; 
        }
Any ideas are greatly appreciated, thank you!
darinsee
Forum Members
Forum Members
Posts: 13
Joined: Sat Sep 08, 2007 10:24 pm

[SOLVED] : Display "CSSMenu - Horizontal" SubMenus Horizontally

Post by darinsee »

Well, I went ahead and hacked the lwis.net linear menu, and used the original CSSMenu ID (primary-nav) to achieve the functionality I was looking for - in case it helps someone else, here's the css that I'm now using instead of the original CSSMenu-Horizontal css:

Code: Select all

#primary-nav,
#primary-nav li,
#primary-nav ul {
 list-style: none; 
 margin: 0;
 padding: 0;
}

#primary-nav {
 position: relative;
 float: right;
 background-color: #012745;  
}

#primary-nav a, a:active, a:visited {
 color: #FFFFFF;             
 line-height: 36px;        
 font-family: Tahoma;       
 font-size: 15px;           
 text-decoration: none;   
}
#primary-nav a:hover {
 color: #dcbb6e;
}

#primary-nav li {
 float: right;             
 vertical-align: middle;
 padding-right: 7px;
 padding-left: 7px;
}

#primary-nav li.hover,
#primary-nav li:hover {
 position: relative;
 cursor: default;
}

#primary-nav ul {
 visibility: hidden;
 position: absolute;
 top: 100%;              /* needed for ie7 otherwise sub shows under main nav */
 right: 0px;
 border-top: none;
 border-left: solid 1px #c3cbd1;
 border-bottom: solid 1px #c3cbd1;
 border-right: solid 1px #c3cbd1;      
 background-color: #f3f4f4;
 width: 968px;
}

#primary-nav ul a, a:active, a:visited {
 color: #6693b7;             
 line-height: 32px;         
 font-family: Tahoma;      
 font-size: 12px;           
 text-decoration: none;     
}
#primary-nav ul a:hover {
 color: #dcbb6e;
 text-decoration: underline;
}

#primary-nav ul li {
 float: right;              
}

#primary-nav li:hover > ul {
 visibility: visible;
}

#primary-nav li.hover,       
#primary-nav li:hover {
 position: static;
}
stevegos

Re: [SOLVED] - Display "CSSMenu - Horizontal" SubMenus Horizontally

Post by stevegos »

Many thanks for posting this. I looked on the web extensively and almost gave up trying to get this working.

Your css works perfectly.

Steve
Evert B.
Power Poster
Power Poster
Posts: 414
Joined: Fri Oct 20, 2006 12:07 pm

Re: [SOLVED] - Display "CSSMenu - Horizontal" SubMenus Horizontally

Post by Evert B. »

Hi all,

I realise this is an old topic, but hopefully you can still help me out.

If I add this code to a stylesheet which I connect to the template it doesn't show anything at all. No menu what so ever.

Can some please give me the code to add in the template which would probably be something like this:

Code: Select all

<div id="primary-nav">
{menu template='cssmenu.tpl'}
</div>
I understand that the stylesheet above is the stylesheet that should create this menu, or is it just a part of this stylesheet?
Is there something else that should be done besides the stylesheet and code in template?

Thanks in advance - Nucleus
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: [SOLVED] - Display "CSSMenu - Horizontal" SubMenus Horizontally

Post by Dr.CSS »

The #primary-nav refers to the UL in the menu, all cssmenu templates use and all IDs have to be unique so if it has 2 you will get problems...
Post Reply

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