Image alignment problem in wordpress

September 13th, 2008 by Lax

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.

Related posts:

  1. Get a Blogger like Stripe in Wordpress Blog to Show Ads
  2. 49 Awesome Twitter Icons for free Download..!
  3. Useful File Sharing Sites for Twitter..!
  4. Turn off Post Revisions and Disable Auto Saves in Wordpress
  5. Awesome ‘404 Error’ Image Collection Waiting..!

7 Responses to “Image alignment problem in wordpress”

Leave a Reply