Archived topic
Align images differently on mobile view
3 replies · Started by Manuela on March 2, 2021
Viewing posts 1–4 of 4
Hello,
In my article I have 2 images, one aligned to the left, and the other to the right. This works for desktop.
I would like to know if there is a way to center the images just on mobile view.
Thank you very much,
Hi there,
try this CSS:
@media(max-width: 768px) {
.wp-block-image figure.alignleft,
.wp-block-image figure.alignright {
float: none;
margin: 0;
}
.wp-block-image figure.alignleft img,
.wp-block-image figure.alignright img {
width: 100%;
}
}
This will apply to any align-left/right images you add to any of your posts.
Thank you very much!
You're welcome
This archived topic is closed to new replies.