Title: image alignment issue despite right css code
Last modified: August 19, 2016

---

# image alignment issue despite right css code

 *  Resolved [Yemoonyah](https://wordpress.org/support/users/yemoonyah/)
 * (@yemoonyah)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/image-alignment-issue-despite-right-css-code/)
 * Hi
 * Since I upgraded to 2.8 my images won’t aligh center. Left and right work fine,
   but if I set them to center they do center in the editor but in the real post
   they align left.
 * My theme css has all the apropriate code:
 *     ```
       /* Floats & Images */
       .right { float: right; }
       .left { float: left; }
       .middle {margin: 0 auto;float:left;}
       .clear { clear: both; }
       img.centered{display: block;margin-left: auto;margin-right: auto;max-width:950px}
       img.alignright{padding: 4px 0 4px 4px;margin: 3px 0 2px 10px;display: inline;max-width:950px}
       img.alignleft{padding: 4px 4px 4px 0;margin: 3px 10px 2px 0;display: inline;max-width:950px}
       img.alignnone{padding:4px 4px 4px 0; margin:3px 10px 2px 0;display: block;max-width:950px}
       .alignleft{float: left;}
       .alignright{float: right;}
       .aligncenter,div.aligncenter {display: block;margin-left: auto;margin-right: auto;}
       .thumbnail, .attachment-thumbnail {max-width:150px;margin:0 1.5em 1.5em 0;float:left}
       .attachment-medium {max-width:950px;overflow:hidden;display: inline}
       .attachment-large {max-width:950px;overflow:hidden;display: inline}
       .content .size-medium, content size-large {margin: 0 1.5em 1.5em 0}
       .home .size-medium, .home .size-large {max-width:590px; height:auto; overflow:hidden;margin:0 .5em .5em 0;}
       dl.gallery-item .gallery-caption {clear:both;float:none;width:150px;}
       dl.gallery-item {width:150px;}
       .gallery-icon .attachment-thumbnail{padding:0;margin:0}
       .gallery {width:auto;}
       ```
   
 * What could be the problem?

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/image-alignment-issue-despite-right-css-code/#post-1115962)
 * Could be that something else in your CSS is over-writing the standard alignment
   style. A link to a page demonstrating the problem might help.
 *  Thread Starter [Yemoonyah](https://wordpress.org/support/users/yemoonyah/)
 * (@yemoonyah)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/image-alignment-issue-despite-right-css-code/#post-1115973)
 * [EXAMPLE POST](http://kabai33.com/2009/03/01/my-first-band-photo-shoot-pol-phases-of-life/)
 * Thanks for helping again 🙂
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/image-alignment-issue-despite-right-css-code/#post-1116005)
 * The style for home page images is over-riding the basic image alignment style
 * Edit style.css (line 137) and change:
 *     ```
       .alignleft{float: left;}
       .alignright{float: right;}
       .aligncenter,div.aligncenter {display: block;margin-left: auto;margin-right: auto;}
       ```
   
 * to
 *     ```
       .alignleft, .post .alignleft{float: left;}
       .alignright, .post .alignright{float: right;}
       .aligncenter,div.aligncenter,.post .aligncenter {display: block;margin-left: auto;margin-right: auto;}
       ```
   
 *  Thread Starter [Yemoonyah](https://wordpress.org/support/users/yemoonyah/)
 * (@yemoonyah)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/image-alignment-issue-despite-right-css-code/#post-1116022)
 * I replaced the code but nothing changed.
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/image-alignment-issue-despite-right-css-code/#post-1116040)
 * Sorry – the changes are still too high up in the stylesheet. Can you try picking
   up that entire block:
 * `.alignleft, .post .alignleft{float: left;}
    .alignright, .post .alignright{float:
   right;} .aligncenter,div.aligncenter,.post .aligncenter {display: block;margin-
   left: auto;margin-right: auto;}’
 * and placing right at the bottom of your stylesheet?
 *  Thread Starter [Yemoonyah](https://wordpress.org/support/users/yemoonyah/)
 * (@yemoonyah)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/image-alignment-issue-despite-right-css-code/#post-1116060)
 * It works 🙂
 * Thanks so much for the help!!!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘image alignment issue despite right css code’ is closed to new replies.

## Tags

 * [align](https://wordpress.org/support/topic-tag/align/)
 * [alignment](https://wordpress.org/support/topic-tag/alignment/)
 * [image](https://wordpress.org/support/topic-tag/image/)
 * [image alignment](https://wordpress.org/support/topic-tag/image-alignment/)
 * [images](https://wordpress.org/support/topic-tag/images/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 2 participants
 * Last reply from: [Yemoonyah](https://wordpress.org/support/users/yemoonyah/)
 * Last activity: [16 years, 11 months ago](https://wordpress.org/support/topic/image-alignment-issue-despite-right-css-code/#post-1116060)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
