Archived topic
Align title and text/images in a blog post
7 replies · Started by Alejandro on May 21, 2021
Hi! Is there a way to automatically align the title and the body of a blog post? In the example below, the title is aligned with the category and date, but the text of the post has a lower margin to the left. I guess I could change that manually, but there may be an easier way. Thanks!
Hi there,
I see this CSS that's causing the issue:
.entry-header {
padding-left: 20px;
}
If you remove that, then set the featured image alignment to left then everything should align.
Thank you Leo, that did the trick. I notice the featured pictures in the Archive section are still centered, even if I change the layout (probably the reason why I had that piece of CSS code before). How can I align the featured images to the left in the archive page, and keep them centered in the post itself? Thanks!
You can set different alignment for archives and posts:
https://docs.generatepress.com/article/adjusting-the-featured-images/
Hi Leo, that's where I've been trying to align the featured images unsuccessfully. I've been trying different image sizes, but regardless of the option (left or right), the images keep being centered. This is only in the Archives section, in each post the alignment works fine.
Hi there,
Featured images when displayed in columns default to align center, as usually there isn't enough room to align them left or right unless the image is small.
You can override this functionality with some CSS:
.generate-columns-activated.post-image-aligned-left .generate-columns-container article:not(.featured-column) .post-image {
float: left;
margin-right: 1.5em;
}
However, you won't notice a difference unless you reduce the width of the featured images.
Thank you, Tom! Now it looks wonderful.
Glad I could help :)