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.

8 Responses to “Image alignment problem in wordpress”

Leave a Reply

IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)

What is 8 + 6 ?
Please leave these two fields as-is: