Image alignment problem in wordpress
If you come across a problem like “Image alignment in WordPress is not working corresponding to your selection in the options(None,Left,Center and Right)” Don’t get panic in this situation, we have a solution here for that problem.
Yes i came across the same problem today in my wordpress “I selected the option Right to align a image in the post and it was showing correctly i mean at right side in editor,but when it comes to end user view after publishing it i could see that image in left side of my post” really hectic situation right? You selected right alignment but got the output as left alignment.

I browsed through the web for the solution and i came across the solution in my friend Daniel’s blog Dailyblogtips.The solution is simple just you need to copy the following code and paste it in your style.css.
img.centered {
display: block;
margin-left: auto;
margin-right: auto;
}img.alignright {
padding: 4px;
margin: 0 0 2px 7px;
display: inline;
}img.alignleft {
padding: 4px;
margin: 0 7px 2px 0;
display: inline;
}.alignright {
float: right;
}.alignleft {
float: left;
}
Paste this code and update your style.css File.Hope your problem got solved now !
If you see still the problem exists try by replacing the .img{} tags with the above code.
Do ask me if you have any problems like this, Comment here- TZI will try to solve your problem.









Hey really worked for me.
Was searching in google and got this from your site..
Thanks for sharing yar.love this one.
Thanks jalk
Hey hit with the same problem and refered so many sites for solution.this is the one i saw working perfectly with my blog…
thanks for sharing lax.
but small problem it’s not fixing the problem until you remove the .img tags ofcourse lax mentioned the same..
good
working fine now good one to share
Einen kleinen Tip noch, das die Tags sind wirklich gut mit einer kleinen Änderung noch vermerkt das es wirklich funktioniert!
Das Leerzeichen zwischen Punkt und Tag Beschreibung gehört weg dann funktionierts wunderbar.
)
. alignright (
float: right;
)
. alignleft (
float: left;
)
But it depends on the theme right..alter the css style File will fix it..
Many thanks! Its works akso for me!
Perfekt!
Thank you