Site logo

Archived topic

Image align center is not working

7 replies · Started by Mi on June 12, 2022

Viewing posts 1–8 of 8

Hi there,

are you using the Classic Editor ?

Yes, I do.

Give this CSS a try:

.entry-content img[style*="center"] {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

This works for any <img> ( in the content ) that has the inline style of: style="text-align: center;" which i believe gets added to an img that you select center align on in the editor.

Thank you so much! This works!
I type everything in the classic text editor by hand, no editor buttons. I can´t get along with the visual & block editors.
So I'm completely fine with this.
Thank you so much for help!

Ah ok :) If you're editing HTML markup then you can use a CSS Class instead.

Glad to be of help

Omg you´re right! Just class aligncenter does it. I was sure I tried it. But maybe I wrote aling instead of align ... happens sometimes and is hard to find for me.

Again - thank you so much!

You're welcome !

This archived topic is closed to new replies.