Archived topic
How to add responsive padding for no-sidebar post/page
3 replies · Started by Trạng on December 15, 2021
Hi everyone, as title, all posts/pages with no-sidebar layout is not responsive, without padding in mobile interface.
How could I fix it?
This is the css I use for single post padding
/** Single post padding **/
@media(min-width: 769px) {
.single.separate-containers.right-sidebar .inside-article,
.single.separate-containers.right-sidebar .comments-area,
.single.separate-containers.right-sidebar .page-header,
.single.separate-containers.right-sidebar .paging-navigation,
.single.one-container.right-sidebar .site-content,
.right-sidebar .inside-page-header {
padding: 30px 20px 120px 120px;
}
.site-content .is-right-sidebar {
width: 29%;
}
body.no-sidebar:not(.home) #page {
padding: 30px 0px;
}
}
Hi Trang,
I don't think you need CSS to add paddings :)
You seem to have a layout element assigned to posts, can you go to Appearance > Elements to check?
In the layout element, change the the content container to default instead of contain:
https://docs.generatepress.com/article/layout-element-overview/#content-1
hi Ying, thank you! Works like a champ 🥰
You are welcome :)