different colors for each menu item at main menu

Rate this topic: Evaluations: 2, 3.50 on the average.Evaluations: 2, 3.50 on the average.Evaluations: 2, 3.50 on the average.Evaluations: 2, 3.50 on the average.Evaluations: 2, 3.50 on the average.Evaluations: 2, 3.50 on the average.3.50 out of 6 based on 2 vote(s)
GK User
Mon May 19, 2014 4:00 pm
Reply with quote
Report this post
Hi,
is it possible, to assign different colors for each menu item at main menu?

Maybe you can give me a step by step example for the first menu item.



Thanks a lot :)
User avatar
Junior Boarder

GK User
Mon May 19, 2014 4:57 pm
Reply with quote
Report this post
Could you please post an url to your site?
User avatar
Moderator

GK User
Mon May 19, 2014 7:37 pm
Reply with quote
Report this post
Cyberek wrote:Could you please post an url to your site?


http://dittelbrunn.puls300.de
User avatar
Junior Boarder

GK User
Tue May 20, 2014 9:52 am
Reply with quote
Report this post
Please edit: /templates/gk_news2/css/override.css and add at its end:
Code: Select all
.gkMenu > ul > li:nth-child(2) {
    background: red;   
}
.gkMenu > ul > li:nth-child(3) {
    background: blue; 
}
.gkMenu > ul > li:nth-child(3) a {
    color: #fff;
}
.gkMenu > ul > li:nth-child(3) li a {
    color: #777;
}
.gkMenu > ul > li:nth-child(4) {
    background: green;   
}

This example show how to set different background to 2,3 and 4 main menu item, and different menu item colour for 3rd item (and bring back original colour for submenu items)
Remember to enable "CSS override" in template settings - advanced section.
User avatar
Moderator

GK User
Tue May 20, 2014 11:12 am
Reply with quote
Report this post
WORKS PERFECT!

Thanks a lot :-)
User avatar
Junior Boarder

GK User
Wed Jun 11, 2014 6:48 am
Reply with quote
Report this post
I have a question: and how do I change the menu color when the mouse its over a menu item?
Ps- I know I've already asked in another post but... well I saw this topic and...
User avatar
Expert Boarder

GK User
Wed Jun 11, 2014 10:04 am
Reply with quote
Report this post
You need to add aditional:
Code: Select all
.gkMenu > ul > li:nth-child(2):hover {
    background: green;   
}
.gkMenu > ul > li:nth-child(3):hover {
    background: yellow; 
}

to define hover colours.
User avatar
Moderator

GK User
Mon Aug 18, 2014 6:54 pm
Reply with quote
Report this post
works not in Internet Explorer 11!
any idea

Thanks a lot



Cyberek wrote:Please edit: /templates/gk_news2/css/override.css and add at its end:
Code: Select all
.gkMenu > ul > li:nth-child(2) {
    background: red;   
}
.gkMenu > ul > li:nth-child(3) {
    background: blue; 
}
.gkMenu > ul > li:nth-child(3) a {
    color: #fff;
}
.gkMenu > ul > li:nth-child(3) li a {
    color: #777;
}
.gkMenu > ul > li:nth-child(4) {
    background: green;   
}

This example show how to set different background to 2,3 and 4 main menu item, and different menu item colour for 3rd item (and bring back original colour for submenu items)
Remember to enable "CSS override" in template settings - advanced section.
User avatar
Junior Boarder

GK User
Wed Aug 20, 2014 2:07 pm
Reply with quote
Report this post
Perhaps Ie11 doent support correctly nth-selector. In that case there is nothing that could be done.
User avatar
Moderator


cron