Archived topic
Center images on mobile devices
6 replies · Started by Thijmen on February 14, 2021
Hi generate press team,
I love your theme. I only would like to center images on mobile devices (not on other devices).
Right now small pieces of text appear next to the images. Since it's only 1 till 3 letters per row it looks ugly and it's almost impossible to read.
I hope that there's an easy solution for this :)
Cheers,
Thijmen
Hi there,
can you share a link to a page where i can see the issue?
Sure. I added my site in the private information section. On some phones it happens in (almost) all the articles. I would like to align all the images on mobile in the center (to prevent this from happening).
Try adding this CSS:
@media (max-width: 600px) {
.wp-block-image .alignright, .wp-block-image .alignleft {
float: none;
margin: 1em auto;
}
}
You can increase or reduce the max-width: 600px property to change when the image becomes center aligned.
Works on laptop.
On mobile still experiencing problems.
See URL with images under private information.
I added the css with simple css (plugin that was recommended on your website).
Hi Thijmen,
I tried both on Chrome simulation and my cellphone, didn't see the same issue here.
I assume it was browser cache issue, try with a new device :)
Hi Ying,
You're right. I deleted cache. Now it's working.
Thanks David and Ying... you guys rock :)