- This topic has 38 replies, 3 voices, and was last updated 4 years, 2 months ago by
David.
-
AuthorPosts
-
January 13, 2022 at 10:55 am #2079443
David
StaffCustomer SupportI adjusted your CSS so the @media is now 1024px to take into account the Tablet screen now uses the mobile view.
Now add this CSS:
@media(max-width: 1023px) { #secondary-navigation, .site-description { display: none; } .site-header .header-image { position: relative; bottom: -15px; } }It will remove the Secondary Nav and the Site title and move the logo down -15px on mobile/tablet devices.
Hover effects – for the secondary nav – add this CSS:
.main-navigation .main-nav ul li a, .secondary-navigation .main-nav ul li a { position: relative; } .main-navigation .main-nav ul li a:after, .secondary-navigation .main-nav ul li a:after { content: ''; display: block; pointer-events: none; position: absolute; bottom: 0; left: 0; width: 100%; height: 0; background-color: #f00; transition: height 0.3s ease-in; } .main-navigation .main-nav ul li:hover a:after, .main-navigation .main-nav ul li[class*="current-menu-"]>a:after, .secondary-navigation .main-nav ul li:hover a:after, .secondary-navigation .main-nav ul li[class*="current-menu-"]>a:after { height: 3px; }Really happy to be of help – no obligation but we do have a donate page here:
January 13, 2022 at 11:04 am #2079457Saša
You are definitely getting a beer 🙂
So can I add same hover effect to main navigation too?
January 13, 2022 at 11:06 am #2079460David
StaffCustomer SupportIs that just the background colors ?
If so you can change them in Customizer > Colors > Primary Navigation.Or do you want the same hover effect as the Secondary nav?
January 13, 2022 at 11:07 am #2079462Saša
Same as second, i have added hover cover already but it is better if it would look like same as secondary nav.
January 13, 2022 at 11:12 am #2079469David
StaffCustomer SupportI edited the second CSS block here:
https://generatepress.com/forums/topic/help-with-creating-header-navigation/page/3/#post-2079443
January 13, 2022 at 11:16 am #2079478Saša
Thank you!
there is one thing left 😀 how can I disable this menu on tablet. Here is iPad screenshot. LINK
January 14, 2022 at 5:10 am #2080070David
StaffCustomer SupportI thought you wanted the mobile menu also on tablet view?
So should it show the same as the desktop ?January 14, 2022 at 5:17 am #2080078Saša
Sorry i have upload wrong screenshot here is what I have meant: Link
January 14, 2022 at 6:39 am #2080155David
StaffCustomer SupportAah ok – so this CSS i provided:
@media(max-width: 1023px) { #secondary-navigation, .site-description { display: none; } .site-header .header-image { position: relative; bottom: -15px; } }Change the max-width: 1023px to
1024px -
AuthorPosts
- You must be logged in to reply to this topic.