WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: fshagan on December 17, 2008, 08:48:56 PM

Title: show_menu2 CSS Issues
Post by: fshagan on December 17, 2008, 08:48:56 PM
I'm porting a template and seem to be stuck on using the "menu-current" class in show_menu2().  Here's my HTML code:

Code: [Select]
<div id="navlist">
      <?php show_menu2(1,SM2-ROOTSM2_CURR+1SM2_ALL, &#39;<li>[a][menu_title][/a]&#39;,&#39;</li>&#39;,&#39;&#39;,&#39;&#39;,0);  ?>
 </div>

This does show the top-level pages on the page as I want it to. 

Here are my CSS declarations for the "navlist" DIV:

Code: [Select]
#navlist li {list-style : none;margin : 0;display : inline;}
#navlist li a {padding : 5px 0.75em;margin : 0;color : #fff;background : #7ABA2E;text-decoration : none;}
#navlist li a:link {color : #fff;background :#7ABA2E;}
#navlist li a:visited {color : #fff;background : #7ABA2E;}
#navlist li a:hover {color : #fff;background : #BA3F2F;}
#navlist .menu-current {color: #fff; background: #BA3F2F;}

All of this works nicely.  The top-level pages display as they should in the menu bar, and when you hover over them they turn red (#BA3F2F;). 

But that last declaration, using .menu-current, is the one I can't get to work.  I've tried it with "li menu-current", "li.menu-current", "li a:menu-current", and every other combination I've thought of (except the right one, of course). 

Anyone have any ideas? 
Title: Re: show_menu2 CSS Issues
Post by: BerndJM on December 17, 2008, 09:25:25 PM
Hi,

Code: [Select]
#navlist .menu-current a {color: #fff; background: #BA3F2F;}
or
Code: [Select]
#navlist li.menu-current a {color: #fff; background: #BA3F2F;}

Regards Bernd
Title: Re: show_menu2 CSS Issues
Post by: fshagan on December 17, 2008, 11:11:53 PM
Thanks, Bernd. 

I must have something over-riding the style elsewhere in my stylesheet, as neither line works to highlight the current page.  Its good to have the correct CSS syntax so I know where else to look.