WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: Cazz on September 28, 2013, 05:46:04 PM

Title: Add CSS to menu2
Post by: Cazz on September 28, 2013, 05:46:04 PM
It is so easy, I have done it many time but ahhhh I have now a blackout and I can't find any old exampel

That I looking for is that I have two CSS for link.

one for a normal link and one for my menu

I use menu2 to create a basic horizontal menu.

Quote
show_menu2(0, SM2_ROOT, SM2_ALL, SM2_ALL, '<td class="[class]">[a][menu_title]</a>', '</td>', '<table class="menu"><tr>', '</tr></table>');

the original have
Code: [Select]
<a href="" class="menu"> so I use
Code: [Select]
a.menu {} to make it to work but how do I add "menu" to menu2??

I did try [a class="menu"] but that he does not like at all.
Title: Re: Add CSS to menu2
Post by: Argos on September 30, 2013, 10:58:21 AM
I don't think you can add a class to a link in showmenu2. Normally you add a class to the <li>, or in your case to the <td>.
Title: Re: Add CSS to menu2
Post by: nibz on September 30, 2013, 12:04:56 PM
Actually it is possible.
By using:
Code: [Select]
<a href="[url]" class="menu">
Title: Re: Add CSS to menu2
Post by: DarkViper on September 30, 2013, 12:29:50 PM
Actually it is possible.
By using:
Code: [Select]
<a href="[url]" class="menu">

this is also possible:
Code: [Select]
<a href="[url]" class="[class] menu">

an other solution is to encapsulate your menu by a container:
Code: [Select]
<div class="menu1">
<?php show_menu2(.......); ?>
</div>

<div class="menu2">
<?php show_menu2(.......); ?>
</div>

//css
a {...}
a:hover {...}

.menu1 .menu-top {...}
.menu1 .menu-parent {...}
.menu1 .menu-current {...}
.menu1 a {...}
.menu1 a:hover {...}

.menu2 .menu-top {...}
.menu2 .menu-parent {...}
.menu2 .menu-current {...}
.menu2 a {...}
.menu2 a:hover {...}
so you can define different independent styles for different menu.