Site logo

Archived topic

Setting top & bottim padding for page layout

13 replies · Started by Trạng on December 11, 2021

Viewing posts 1–14 of 14

Hi there, I want to set the top & bottom padding for the main content area for pages on my site.

How could I do that? The top & bottom content is very close to header & footer right now. I can't find where to fix it :)

Can anyone help me with this problem?

Still wait for the support

Hi there,

make sure your Content Container is set to Default:

https://docs.generatepress.com/article/content-container/

And if you can please afford us a little patience, especially on a Sunday, we aim to answer all support topics within 24hrs, spamming your own topics is not going to help us in any way to respond any faster. Thanks in advance.

Hi thanks for the rep.

It's in default setting already but there is no padding in top & bottom.

Hi there,

I see you're using a Layout element to set the content container to Full width (no padding).

This particular setting removes the padding added by the customizer.

If you wish to keep both the padding and the layout element setting, you'll have to manually re-add the padding with CSS.

Example:

#content {
    padding: 40px;
}

Hi Elvin, but if I only use

#content {
    padding: 40px;
}

This padding will be removed

 .right-sidebar .inside-page-header {
        padding: 30px 20px 120px 150px;

I only want page layout & posts in no-sidebar layout have top & bottom padding.

You can modify it to this:

body.no-sidebar #page {
    padding: 30px 20px 120px 150px;
}

Or set it to padding: 30px 0px;. Adjust it to your preference.

The

padding: 30px 0px; works like a champ.

Thanks alot!

No problem. :D

Hi Elvin, is there anyway that allow me exclude the 30px top padding for the homepage? -> Screenshot

I just realize that after use the padding 30px 0px, all the posts pages with no sidebar works like a champ but it also apply top 30px padding for homepage :D

This line:

body.no-sidebar #page {

becomes:

body.no-sidebar:not(.home) #page {

It works so well! Thank David Sir!

Glad we could be of help

This archived topic is closed to new replies.