- This topic has 17 replies, 3 voices, and was last updated 5 years, 5 months ago by David.
-
AuthorPosts
-
November 14, 2018 at 4:32 am #726970Zoran
Hi,
I’m trying to achieve this look with the navigation and header:
I’m having trouble adding that top effect on the menu item when it’s current or hovered, as well as that rectangle before the logo.
Can you provide assistance?
Kindly,
ZNovember 14, 2018 at 5:46 am #727004LeoStaffCustomer SupportHi there,
I would recommend using this method:
https://docs.generatepress.com/article/navigation-logo/#navigation-as-headerCan you do that first and I can provide some CSS?
Let me know ๐
November 14, 2018 at 1:35 pm #727488ZoranHi,
Yes, of course, I have done these steps:
1.Set your navigation location to Below Header or Above Header in Customize > Layout > Primary Navigation.
2.Remove your site title/tagline/logo from the header in Customize > Site Identity.
3.Set your Navigation Logo Position to Sticky + Static.
4.Set your Sticky Navigation Transition to None.
5.Then, full remove your header using the CSS below:November 14, 2018 at 5:15 pm #727600LeoStaffCustomer SupportTry this CSS:
.main-navigation .main-nav ul li a { border-top: 2px solid transparent; } .main-navigation .main-nav ul li a:hover, .main-navigation .main-nav ul li[class*="current-menu-"] > a { border-top: 2px solid #11b2ae; }
November 14, 2018 at 11:31 pm #727721ZoranHi!
This works, only the border is too big right now, and the whole header is tiny in height:
November 15, 2018 at 5:01 am #727880LeoStaffCustomer SupportHmm the border is the menu item width plus the padding.
Can you link me to the example site and I can see how they did it?
November 15, 2018 at 3:39 pm #728491ZoranThe image i gave as an example is just a mockup in PS ๐
November 15, 2018 at 5:13 pm #728534LeoStaffCustomer SupportHmm so would it be a fixed length regardless the length of the menu item?
What about a popular solution like this?
https://docs.generatepress.com/article/adding-menu-hover-animation/November 19, 2018 at 5:30 am #730881ZoranHi,
Sorry for the late response. Yes, the length can be a fixed value!
November 19, 2018 at 9:13 am #731173DavidStaffCustomer SupportHi there,
the height of the header is defined by the size of the logo or by increasing the line-height of the menu items.
Whats wrong with the code that Leo provided here it can be easily adjusted for the border to sit at the top of the navigation. Let me know.
November 20, 2018 at 12:36 am #731755ZoranHi, I tried using the code, it did not work.
November 20, 2018 at 3:13 am #731862DavidStaffCustomer SupportCan you add the code so i can see what the issue is and provide a fix?
November 20, 2018 at 3:30 am #731893ZoranI’ve added it.
November 20, 2018 at 3:53 am #731918DavidStaffCustomer SupportOk so replace it with this, i have commented the lines you need / can edit for colors, thickness and width:
@media (min-width: 769px) { .main-navigation .menu > li > a::after { content: ""; position: absolute; right: 0; left: 50%; top: 0; -webkit-transform: translateX(-50%); transform: translateX(-50%); display: block; width: 0; height: 2px; /* Change thickness of border */ background-color: #1e73be; /* Change Color */ transition: 0.3s width ease; } .main-navigation .menu > li.current-menu-item > a::after, .main-navigation .menu > li.current-menu-ancestor > a::after, .main-navigation .menu > li > a:hover::after { width: 50%; /* Change width of border */ } }
November 20, 2018 at 3:59 am #731924ZoranWorks, and looks awesome now. Thank you!
Regarding the rectangle on the left of the logo, how would you suggest adding it?
-
AuthorPosts
- You must be logged in to reply to this topic.