- This topic has 16 replies, 4 voices, and was last updated 2 years, 3 months ago by Elvin.
-
AuthorPosts
-
December 23, 2021 at 8:38 am #2057804alexis
Hello I see that the search bar uses the width of the navigation. Can it take the whole width like the attached example?
December 23, 2021 at 9:58 am #2057889DavidStaffCustomer SupportHi there,
should be possible, do you have a dev site setup with the nav etc. in place ? I can then take a look at the CSS requirements to do that.
December 23, 2021 at 10:05 am #2057901alexisThanks yes that would be great
December 23, 2021 at 10:40 am #2057921DavidStaffCustomer SupportMaybe something like this:
.inside-navigation { position: static; } .inside-header { position: relative; } .navigation-search.nav-search-active { bottom: 0; background: transparent radial-gradient(closest-side at 50% 50%, #FFAA29 0%, #FF8424 100%) 0% 0% no-repeat padding-box; display: flex; } .navigation-search input[type="search"], .navigation-search input[type="search"]:active, .navigation-search input[type="search"]:focus { position: relative; background-color: #fff; /* this can be set in the Customizer */ max-width: calc(100vw - 200px); /* this needs adjusting for smaller screens */ margin: auto; border-radius: 50px; top: 16px; }
Left a couple of comments in the above CSS.
Adding placeholder text – see here:
https://docs.generatepress.com/article/generate_navigation_search_output/#add-a-placeholder
December 23, 2021 at 10:46 am #2057923alexisPerfect, thank you very much
December 24, 2021 at 3:50 am #2058334DavidStaffCustomer SupportYou’re welcome!
January 10, 2022 at 10:08 am #2075709alexisHi David,
I’m coming back to you because in mobile it doesn’t display correctly. And I don’t understand how it works.
I added a fixed position in addition so the menu changes. We can not have the same menu. Because there are two menus. I corrected it on desktop.
January 10, 2022 at 4:07 pm #2075995ElvinStaffCustomer SupportHi Alexis,
Can you share a screenshot of the part in mobile that doesn’t display correctly?
And perhaps provide a mockup of how you want it to be laid out?
January 10, 2022 at 11:48 pm #2076207alexisHi Elvin,
Actually I want to have the same nav in static position (i.e. when the page is loading, without scrolling) as the nav in sticky position.
Why can’t we have the same nav in fixed and static ? because here I have to modify 2 nav
Concerning the search bar, I want to have the same thing as in desktop. Because when we click, there is no cross to close and especially the search bar does not cover the mobile navigation.
January 11, 2022 at 11:30 am #2077024alexisDo you have a solution please ? ๐
January 11, 2022 at 11:59 am #2077070YingStaffCustomer SupportHi Alexis,
Can you go to customizer > layout > sticky navigation, set it to
desktop only
?Then add this CSS:
@media (max-width: 1024px) { #masthead { position: fixed; top: 0; left: 0; right: 0; z-index: 999; } }
Let me know if this helps ๐
January 11, 2022 at 12:19 pm #2077088alexisIt’s perfect, thank you. I just have the problem of the search bar. It doesn’t cover the menu like on desktop.
January 11, 2022 at 2:07 pm #2077175YingStaffCustomer SupportYou have this CSS in your child theme:
https://www.screencast.com/t/p758NF0ZJust activate the CSS should achieve what you are looking for on mobile.
January 11, 2022 at 3:33 pm #2077227alexisYes sorry but with this solution I don’t have the button to close anymore.
January 11, 2022 at 9:25 pm #2077407ElvinStaffCustomer SupportHi there,
Try this CSS for the close button.
@media (max-width: 768px){ nav#site-navigation.has-active-search .menu-bar-items { display: block !important; z-index: 101; margin-top: -90px; background-color: unset !important; } }
-
AuthorPosts
- You must be logged in to reply to this topic.