Archived topic
Image align center is not working
7 replies · Started by Mi on June 12, 2022
Hello, I have problems getting an image centered (the map on https://ffcorner.com/testwp/final-fantasy-vii-chocobozucht/#Wo-man-einen-Chocobo-faengt)
I tried style and float and text-align, setting it inside a p or div, adding extra CSS ... it keeps staying left. Any ideas?
Thank you!
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 !