Archived topic
Designing related query
15 replies · Started by Ajay on January 19, 2023
I have 2 questions-
1st- how can I make the search box sticky on the top as it is while scrolling up the page?
2nd – how can I make menu bar navigation pages as button so I could control that in generateblocks pro?
Hi there,
can you share a link to your site where i can see this ?
Yes
Let's deal with one question at a time.
In order to make the search box sticky, it has to be in its own container, so the 1st container needs to be splitted into 3 containers.
https://www.screencast.com/t/GQ7geHQb6
Yes, i did that. what should i do now
Hi Ajay,
You'll need to take the 3 Container Blocks out of the Parent Container to make the Search Box sticky.
Once you're done with this, let us know.
yes i have done that
They're still inside a parent container.
For clarity, can you share a screenshot of your structure as seen in the list view?
Uploading Screenshots: https://docs.generatepress.com/article/using-the-premium-support-forum/#uploading-screenshots
Now I have done that, i have now three containers
Great! Now, try adding this through Appearance > Customize > Additional CSS:
.gb-container.gb-container-58ea0e21.sticky-container {
position: sticky;
top: 0;
z-index: 10000;
}
how to add gradient outside the search bar like given website in private box
The Search box in your reference site has a different structure. It's likely custom coded or from a plugin.
With the WP Search Block, you can try adding this CSS:
.wp-block-search__inside-wrapper {
background: linear-gradient(90deg, #FF596F, #E41421, #ED207B, #6551CC, #47CCCC, #99CCBB, #FF596F);
padding: 1px;
}
This I believe is the closest you can achieve with the structure of the WP Search Block.
yup thanks, it's cool, but it is spreading too much light while clicking on the box eg. red color is too much light I don't need the inside color I just want it outside. also, between the search field and button is showing some reddish color which I don't want. please look in private box
Add this CSS:
.wp-block-search .wp-block-search__button {
margin-left: 0;
}
.wp-block-search input[type="search"] {
background-color: #fff !important;
}
Working well thanks.
2nd – how can I make menu bar navigation pages as buttons so I could control that in generateblocks pro