WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • Add CSS to menu2
  • Print
Pages: [1]   Go Down

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

Offline Cazz

  • Posts: 93
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.
Logged

Argos

  • Guest
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>.
Logged

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">
Logged

Offline DarkViper

  • Forum administrator
  • *****
  • Posts: 3087
  • Gender: Female
Re: Add CSS to menu2
« Reply #3 on: September 30, 2013, 12:29:50 PM »
Quote from: nibz on September 30, 2013, 12:04:56 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.


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

"We need education to cope with digitalization - and NOT the digitalization of education.!"

Tägliches Stoßgebet: Oh Herr, wirf Hirn vom Himmel !

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • Add CSS to menu2
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2