Apply css style for individual menu item

Everything to do with Joomla! 3.x templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
Rutger1973
Joomla! Apprentice
Joomla! Apprentice
Posts: 48
Joined: Wed Aug 20, 2008 11:27 am

Apply css style for individual menu item

Post by Rutger1973 » Wed Feb 14, 2018 3:41 pm

Hi guys,

I need to style my menu items individually. I've been looking on the interweb and honestly cannot believe that I couldn't find any decent posts about this.

I need to show a transparant image on hover and on the active state. Every menu item has a different image. Can you help me with the CSS code? I presume I need to work with menu ID's?

www.testeenwebsite.nl

All help highly appreciated

Thanks!

User avatar
effrit
Joomla! Guru
Joomla! Guru
Posts: 846
Joined: Sun Nov 12, 2017 2:21 pm
Location: middle of Russia
Contact:

Re: Apply css style for individual menu item

Post by effrit » Wed Feb 14, 2018 3:47 pm

Code: Select all

.item-101.current{
    background: url(/images/projecten/Project-Welgelegen-stadsvilla-en-serre.jpg);
}
you already have classes for menu items like item-101 so just use them.

add .current to select active state.

Rutger1973
Joomla! Apprentice
Joomla! Apprentice
Posts: 48
Joined: Wed Aug 20, 2008 11:27 am

Re: Apply css style for individual menu item

Post by Rutger1973 » Thu Feb 15, 2018 8:56 am

Hi Effrit,

Thanks for your reply but this doesn't make any sense to me. I have not made this class, certainly not for the menu items. I also cannot find this code in the css files...

User avatar
effrit
Joomla! Guru
Joomla! Guru
Posts: 846
Joined: Sun Nov 12, 2017 2:21 pm
Location: middle of Russia
Contact:

Re: Apply css style for individual menu item

Post by effrit » Thu Feb 15, 2018 10:05 am

You must learn about how css work.
I give you exactly what you asking but now you ask me teach you about css basics?
You cant find this code because you must add it by yourself in template .css file or in template special textarea if your template support it this way.
And Joomla making custom classes for menu items (at least your menu module do it), so you must just open page code or inspect menu item to figure it out.

Rutger1973
Joomla! Apprentice
Joomla! Apprentice
Posts: 48
Joined: Wed Aug 20, 2008 11:27 am

Re: Apply css style for individual menu item

Post by Rutger1973 » Thu Feb 15, 2018 8:18 pm

Hi Effrit... gotcha! thanks...got it up and running. Now I have to figure a way out to show the same on mobile but I will manage. Thanks again!


Locked

Return to “Templates for Joomla! 3.x”