- This topic has 5 replies, 3 voices, and was last updated 3 years, 4 months ago by
Fernando.
-
AuthorPosts
-
December 3, 2022 at 3:40 pm #2448459
Alan
Added the below CSS, that I found in the forum, to modify one of the three elements in the main navigation menu. All the elements are anchors, I believe.
Was interested in making menu item 1711, along with background and hover color, to also color while the active page. The other elements already do this from the customizer.
Was also interested in creating an underline, along with color, for all the elements while on the active page.
Can’t seem to work out the correct CSS.
Thanks for your help.#site-navigation .main-nav > ul > li#menu-item-1711:hover > a {
background-color: #f3f3f3;
color: blue;
}
#site-navigation .main-nav > ul > li#menu-item-1711 > a {
background-color: #f3f3f3;
border-radius: 50px;
color: black;
}December 4, 2022 at 5:51 am #2448953David
StaffCustomer SupportHi there,
can you share a link to the site where you want to make this change ?
If you need to provide a URL / login then you can add it to the Private Information field below you reply.December 4, 2022 at 6:13 am #2448970Alan
Using the forum, I added this CSS. Everything works fine but I’ll take any advice to make anything better.
Thanks.
Added private info.
I also realized that active and current are different.#site-navigation .main-nav > ul > li[class*=”current-menu-“] > a {
border-bottom: 3px solid black;
}
#site-navigation .main-nav > ul > li#menu-item-1711[class*=”current-menu-“] > a {
border-bottom: 4px solid black;
color: var(–accent)
}December 4, 2022 at 7:10 pm #2449631Fernando Customer Support
Hi Alan,
What sort of change are you trying to make?
#site-navigation .main-nav > ul > li[class*="current-menu-"] > a { border-bottom: 3px solid black; }Do you want a smaller underline? If so, you can try replacing this:
with this:
#site-navigation .main-nav > ul > li[class*="current-menu-"] > a:after { content: ""; display: block; height: 1px; width: 50%; transform: translateX(50%); position: absolute; bottom: 0; left: 0; background-color: #000; z-index: 999; } #site-navigation .main-nav > ul > li[class*=”current-menu-“] > a { position: relative; }December 5, 2022 at 3:50 am #2450042Alan
Thanks a lot for your help Fernando. I’ll keep playing and learning.
AlanDecember 5, 2022 at 4:59 pm #2450943Fernando Customer Support
You’re welcome, Alan!
-
AuthorPosts
- You must be logged in to reply to this topic.