- This topic has 7 replies, 4 voices, and was last updated 3 years, 6 months ago by Elvin.
-
AuthorPosts
-
October 14, 2020 at 1:34 am #1488065Carsten
Hi there, I have created a hook element, with some custom code for special navigation tabs,using the custom hook
generate_inside_secondary_navigation
I would have expected that the content could be customized with the layout options like Navigation Alignment or Color under the Secondary Navigation options, but it can’t?
Thanks!
October 14, 2020 at 2:26 am #1488147DavidStaffCustomer SupportHi there,
the customizer has no control over what is added to a Hook as it would have no way of identifying the variable content a user may add.
Happy to help with some CSS if you can link me to a page where i can see the secondary navigation.
October 14, 2020 at 2:51 am #1488182CarstenHi David, that would be a great help,
I want the buttons centered, and color control over hoover and active button
Thanks in advance!
Carsten
October 14, 2020 at 4:52 am #1488322DavidStaffCustomer SupportTry this CSS:
#secondary-navigation .secondary { display: flex; justify-content: center; } .secondary ul li a.button { color: #fff; background-color: #f00; } .secondary ul li a.button:hover { color: #fff; background-color: #00f; }
October 14, 2020 at 6:36 am #1488466CarstenThanks a lot, working great, is there something about that it is not possible to change the color of the active tab with css alone, without changing the markup?
Before I had the active tab underlined, is this code reusable for the secondary navigation element?
/*SECONDARY NAVIGATION STYLING, CURRENT, HOVER UNDERLINE*/ @media (max-width: 769px) { .secondary-navigation .secondary-menu > .menu-item > a::after { content: ""; position: absolute; right: 0; left: 50%; bottom: 10px; -webkit-transform: translateX(-50%); transform: translateX(-50%); display: block; width: 0; height: 1px; background-color: #3f3f3f; transition: 0.3s width ease; } .secondary-navigation .secondary-menu > .menu-item.current-menu-item > a::after, .secondary-navigation .secondary-menu > .menu-item.current-menu-ancestor > a::after, .secondary-navigation .secondary-menu > .menu-item > a:hover::after { width: 70%; } }
Before I had a border above the secondary navigation, now the width of the border is only covering the buttons, not full width. Can this be changed for the element?
.secondary-nav-aligned-center .secondary-navigation ul, .secondary-nav-aligned-right .secondary-navigation ul { border-top: 2px solid #e4e4e4; }
Thanks
October 14, 2020 at 1:35 pm #1489217TomLead DeveloperLead DeveloperHi there,
That CSS should work fine with the Secondary Nav.
Feel free to share your URL if you’d like us to take a look.
October 14, 2020 at 1:56 pm #1489254CarstenSure, thanks for looking into this
October 14, 2020 at 3:42 pm #1489353ElvinStaffCustomer SupportHi,
Thanks a lot, working great, is there something about that it is not possible to change the color of the active tab with css alone, without changing the markup?
You can try making use of
:visited
on your CSS.Example:
.secondary ul li a.button:visited { color: #fff; background-color: #e4e4e4; }
Let us know if this works for you.
-
AuthorPosts
- You must be logged in to reply to this topic.