Hi at Kriesi,
I like to change the background color of the menu items in the mega menu dropdown. Special: It should be alternating, so the first item should be white, the next gray, the next white again and so on. Like a zebra crossing :-) It that possible?
Best Regards
Hey Sigmund,
Yes that is possible, you can inspect each menu item in your browser in order to find the ID. Then you can target each menu item individually using the ID.
Best regards,
Rikard
Hi Rikard,
yes, I have tried that but that only makes a small area behind the font colored, not the whole box.
Best Regards
is there a page we can see ?
on these circumstances you can use the nth-child (2n+1) or nth-of-type(2n+1) – or alternating nth-child(even) and nth-child(odd)
f.e.:
.header_color .main_menu .menu ul ul li:nth-child(2n+1) a:hover {
background-color: #ccc
}
if you want not the hover style get rid of that ( for odd take 2n)
sometimes ( if there are other elements in between these rows ( ul, ol etc ) or maybe an emtpy p-tag the nth-of-type will be a good and elegant way to solve that problem.
li:nth-of-type(2n) will alter every second li element even if there are other elements in between
Hi Guenni,
you got me on the right track. For me works the following code:
#top #header .avia_mega_div ul, #top #header .avia_mega_div li:nth-child(2n+1) {
background-color: red;
}
So thanks all!
Best Regards
Hi Sigmund,
Glad you got it working for you! :)
If you need further assistance please let us know.
Best regards,
Victoria