Archived topic
Inline Header elements
9 replies · Started by Angelo on October 26, 2021
I have a search bar and a currency selector in the header widget. On a desktop site, I would like them to be inline, not on top of each other.
Due to space, on top is fine with mobile.
Hi Angelo,
Can you link us to the site you're working on? To inspect the page and have an idea on how to go about it.
You can use the private information text field to provide the details. :D
You can try adding this CSS:
div#block-block-12 .content {
display: flex;
align-content: center;
align-items: center;
}
This vertically centers the elements. Let me know if you have any specific layout alignment in mind. :D
I placed this in the functions file of the child theme and this caused a critical error on the site
The code I've provided is a CSS as previously mentioned.
It should be added on a .css file or on Appearance > Customize > Additional CSS.
Here's how to add CSS - https://docs.generatepress.com/article/adding-css/
uh, now I get it.
Works fine for desktop, but on mobile, the 3 elements are in line and go way too far to the right
Do you want to keep it stacked on mobile?
If you only want to inline it on desktop, you can add this CSS instead.
@media (min-width:769px){
div#block-block-12 .content {
display: flex;
align-content: center;
align-items: center;
}
}
perfect. Thanks
No problem. :D