I made some posts in my new blog and had left-aligned images, with the text flowing around them.
When I checked them on my mobile, the images were floating above the text as I expected, but they were left-aligned and there was no white space below them.
After many unsuccessful attempts to centre the images, I finally did it by setting the margins to auto. I also added 10px of padding beneath them, so the text wasn’t touching them.
Thought I’d share the code here in case others would like to use it. I put it in my child theme style.css
/* Aligning images in posts on mobiles */
@media (max-width: 768px) {
.alignleft,
.alignright {
float: none;
display: block;
margin-left: auto;
margin-right: auto;
padding-bottom: 10px;
}
}
Makes things much prettier I think.