I'm porting a template and seem to be stuck on using the "menu-current" class in show_menu2(). Here's my HTML code:
<div id="navlist">
<?php show_menu2(1,SM2-ROOT, SM2_CURR+1, SM2_ALL, '<li>[a][menu_title][/a]','</li>','','',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:
#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?
Hi,
#navlist .menu-current a {color: #fff; background: #BA3F2F;}
or
#navlist li.menu-current a {color: #fff; background: #BA3F2F;}
Regards Bernd
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.