Archived topic
Custom content padding
9 replies · Started by Dev on January 8, 2021
Hello,
Is it possible to do custom content padding?
I have created a specific post layout in the element section. For that, I want my custom content padding.
Top-20 Bottom-20 Right-20 Left-20.
Please let me know.
Hi there,
Not sure if I fully understand.
Which element are you referring to?
Can you link me to the specific page in question?
Hello,
I simply saying.
I had made a single post layout in appearance > Element > Layout
For that single post layout, I want custom content padding.
Top-20 Bottom-20 Right-20 Left-20.
Layout elements does not have an option to set custom content padding unfortunately.
But if the goal is to change the content padding of single posts, we can try this CSS:
.single-post .inside-article {
padding: 20px;
}
hello,
Where I have to add this CSS.
If I will add this in a simple CSS plugin it will change the padding for all site posts.
I only want to change the content padding for only a few posts.
So where I need to add this code.
CSS can be added using one of these methods:
Adding CSS: https://docs.generatepress.com/article/adding-css/
- If you use Simple CSS, then it gives you a metabox in each post so that the CSS will only apply to the post with the CSS:
https://www.screencast.com/t/pPq4cs9Sz
Then this is the CSS you would use:
.inside-article {
padding: 20px;
}
- If you use Additional CSS, then you'd need to target the posts that you want to apply the CSS to like this:
body.postid-123 .inside-article,
body.postid-1234 .inside-article,
body.postid-12345 .inside-article {
padding: 20px;
}
hello,
The below CSS is not working.
.inside-article {
padding: 20px;
}
Please let me now
Hi there,
can you link us to a post where the Layout Element is applied ?
Hello,
Thanks, I solved the problem.
Glad to hear that