Support Forum

Please note that this forum is only available to you in read only mode. In order to contribute to this conversation you will need to renew your subscription.

change the (background) color of one menu-item

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Hi,

I was wondering, if I could highlight one menu-item in particular, by giving it another background color? (Or if that isn't possible, by changing the color and style of the text)

I'm asking you this for the website www.agp-equipment.be where we would like to put the item "webshop" on a green background.
We are using the revision template.

thanks in advance for your answer!

kind regards,
Karen
  • TwoStudios's Avatar
  • TwoStudios
  • LIfetime Developer - Big Bamboo
  • 54 posts
  • Karma: 0
The administrator has disabled public write access.
Hi Karen,

You would need to use an attribute selector using the li e.g.

#navwrap ul.nav > li[data-id="160"] {background:red;}

or if you wanting the font it would require a link as well

#navwrap ul.nav > li[data-id="160"] a {color:blue;}

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Hi Paul,

I've tried this... and it works... however, not for the item I need it for...

i copied your text, and replaced the id "160" with "183" (the menu-item "webshop" which I would like to highlight); but then nothing happens...
only when I leave the text to "160", then one item has a red background... (but not the correct one... ;-) )

what am I doing wrong?

kind regards,
karen
  • TwoStudios's Avatar
  • TwoStudios
  • LIfetime Developer - Big Bamboo
  • 54 posts
  • Karma: 0
The administrator has disabled public write access.
I just tried with 183 and it works correctly
Attachments:
  • mihha's Avatar
  • mihha
  • 12 Month Developer
  • 711 posts
  • 44 Thanks
  • Karma: 11
The administrator has disabled public write access.
Hi,

I'm trying to do the exact same thing, for this website:
www.optiekbogaert.be

the menu-item "Nieuws" should be highlighted, with a different background-color.

I tried the following in custom.css:

#navwrap ul.nav > li[data-id= "460"] {background:#666666}

but this doesn't seem to change anything.

Can you help?

thanks in advance!

kind regards,
Karen
  • TwoStudios's Avatar
  • TwoStudios
  • LIfetime Developer - Big Bamboo
  • 54 posts
  • Karma: 0
The administrator has disabled public write access.
Hi Karen,

Its a different template framework so the code is slightly different

Try instead adding

#nav ul li.item-460 {background-color:red;}

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
works perfectly!
thanks!
  • TwoStudios's Avatar
  • TwoStudios
  • LIfetime Developer - Big Bamboo
  • 54 posts
  • Karma: 0
The administrator has disabled public write access.
You're welcome

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Happy Campers