Archived topic
Page hero on post
11 replies · Started by Bernhard on March 13, 2021
Hello,
I made a post with a page hero.
The problem I have now is how to set the padding on top. For pages I use
.page-hero {
margin-top: 10px;
}
but it does not work on this post. How can I solve it?
Hi Bernhard,
Not sure if I fully understand.
The page you linked is a single post and I can see the CSS working:
https://www.screencast.com/t/QRj5m4URhV
Hi Leo,
strange. There shall be less space between navigation and hero image like here.
The correct page is using this option:
https://docs.generatepress.com/article/content-container/#contained
OK. Is it possible to set a padding on the left and on the right of the browser window?
The customizer has that option:
https://docs.generatepress.com/article/content-padding/
However, it will only work if the content container is set to default:
https://docs.generatepress.com/article/content-container/#default
But then you can just set the top and bottom padding to 0 in the customizer.
OK. But now I have a problem with the other posts with featured image on mobile. There is too much space between the featured image and navigation on mobile. On desktop it's fine.
The css is
@media(min-width: 769px) {
body.single-post .inside-article .page-header-image-single {
margin-top: 10px;
}
}
@media(max-width: 768px) {
body.single-post .inside-article .page-header-image-single {
margin-top: 10px;
}
}
Hmm this is what I'm seeing on desktop and I don't think it's correct:
https://www.screencast.com/t/r600zhcau8z
I also highlighted the problematic CSS in the screenshot.
Probably Cloudflare has shown an old version? I checked now over VPN and see the actual code https://share.getcloudapp.com/L1uNjm8N
If you change the browser width of the post you can see at 768 px how the sidebar is removed and the image jumps down.
Have you tried reducing the top content padding with the mobile toggle on?
https://docs.generatepress.com/article/content-padding/
Oh, I missed this. Now it works. Thank you :)
No problem :)