Author Topic: Add CSS to menu2  (Read 2330 times)

Offline Cazz

  • Posts: 68
Add CSS to menu2
« 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.

Offline Argos

  • Posts: 2542
  • Gender: Male
    • Argos Media
Re: Add CSS to menu2
« Reply #1 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>.
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
----------------------------------------------------------------
Please don't request personal support, use the forums!

Offline nibz

  • Posts: 684
  • Gender: Male
Re: Add CSS to menu2
« Reply #2 on: September 30, 2013, 12:04:56 PM »
Actually it is possible.
By using:
Code: [Select]
<a href="[url]" class="menu">

Offline DarkViper

  • Forum administrator
  • *****
  • Posts: 3061
  • Gender: Female
Re: Add CSS to menu2
« Reply #3 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.


Der blaue Planet - er ist nicht unser Eigentum - wir haben ihn nur von unseren Nachkommen geliehen

"You have to take the men as they are… but you can not leave them like that !" :-P
Das tägliche Stoßgebet: Oh Herr, wirf Hirn vom Himmel !