How to center images on mobile only (the7)


I’m looking to center my images in my posts on mobile only as they’re centered to the right on desktop.
A good example here:

How can I make that happen?

You target mobile in CSS based on the display width, like this:

@media only screen and (max-width: 768px) {
// Mobile-specific CSS here

And then, depending on your code or theme, something like this for the actual CSS:

img {
display: block;
margin: 0 auto;

Hey Meekeboose,

thank you for your reply! However, I’m very new to Wordpress and don’t know any coding so I’m not entirely sure where I can find this, or how I can edit it. Also, I cannot code… Could you elaborate a bit if you have the time?

Thank you!


I’m looking to center my excerp displayed right underneath the first photo ( throughout all my posts. How do I do that?