Archived topic
Global default site container
7 replies · Started by ammgbr on March 26, 2023
I want all my pages to have a preset padding and margin globally controlled so that I don't need to introduce a new page container for each page.
I tried using elements blocks and hooks but haven't managed to implement this.
I would appreciate any advice on how to best approach this.
Hello there,
Do the paddings in Appearance > Customize > Layout > Container work for you? Reference: https://docs.generatepress.com/article/content-padding/
If not, we can use custom CSS. Let us know if you need help with regard to this.
I dont get the same level of control - padding and margin for the page container of all pages. I thought it could be done via the elements.
I can try a CSS solution.
What you can do with an Element is set a width: https://docs.generatepress.com/article/layout-element-overview/#content-1
Otherwise, our recommendation is to add a Container Block for each page and set it there. But, if you don't like this method, we can then try CSS as mentioned.
The other way is the one also mentioned through Appearance > Customize > Layout > Container.
What sort of padding and margin are you wanting for each page?
I've tried using: The other way is the one also mentioned through Appearance > Customize > Layout > Container.
However, I get no control over margin. And even padding does not appear applied unless if there's something missing.
Adding a container on each page is laborious when I want to make changes.
For more global control I guess I have to use CSS. I can try that and see how it works.
What sort of padding and margin are you wanting for each page? Can you give a bit of an idea of the spacing you're going for?
Would it be like this where the margin is for the entire page including the header?: https://share.getcloudapp.com/llu75k5e
Or, are you wanting it just for the content? If so, does a CSS like this work?:
.site-content {
margin: 50px;
padding: 50px !important;
}
Hi I want it just for content. However I was also looking for a separate way to change the padding/margin around the search bar.
Does something like this work for the Search Bar?:
.inside-navigation form.wp-block-search {
margin: 10px;
}