Title: Image alignment
Last modified: August 19, 2016

---

# Image alignment

 *  [phiegeeless](https://wordpress.org/support/users/phiegeeless/)
 * (@phiegeeless)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/image-alignment-8/)
 * Hi folks – as you can see on the unfinished site I am struggling to center the
   image or is it the container? the theme is twenty ten. I have tried loads of 
   tweaks within css but none seem to work. Help!
    [](http://www.sharpehairandbeauty.co.uk)

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

 *  [Nickybbb](https://wordpress.org/support/users/nickybbb/)
 * (@nickybbb)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/image-alignment-8/#post-1782756)
 * try this in your css:
 *     ```
       img.centered {
           display: block;
           margin-left: auto;
           margin-right: auto;
       	border: 0px;
       }
   
       img.alignright {
           padding: 4px;
           margin: 0 0 2px 7px;
           display: inline;
       	border: 0px;
       }
   
       img.alignleft {
           padding: 4px;
           margin: 0 7px 2px 0;
           display: inline;
       	border: 0px;
       }
   
       .alignright {
           float: right;
       }
   
       .alignleft {
           float: left;
       }
       ```
   
 *  Thread Starter [phiegeeless](https://wordpress.org/support/users/phiegeeless/)
 * (@phiegeeless)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/image-alignment-8/#post-1783080)
 * Not worked, as you can see, have I made mistake? see code below
    #content img{
   margin: 0; height: auto; max-width: 940px; width: auto;
 * }
    #content .attachment img { max-width: 900px; } #content .alignright, #content
   img.alignright { padding: 4px; margin: 0 0 2px 7px; display: inline; border: 
   0px; } #content .alignleft, #content img.alignleft { padding: 4px; margin: 0 
   7px 2px 0; display: inline; border: 0px; } #content .aligncenter, #content img.
   centered { display: block; margin-left: auto; margin-right: auto; border: 0px;}#
   content img.alignleft { float: left; } #content img.alignright { float: right;}#
   content img.aligncenter { margin-bottom: 12px;
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/image-alignment-8/#post-1783097)
 * twenty ten already comes with the styles for image alignment – therefore my guess,
   that you have changed something in style.css of the theme, that stops the application
   of styles (happens easily, even with small typing errors)
 * can you re-post a link to your site?
 *  Thread Starter [phiegeeless](https://wordpress.org/support/users/phiegeeless/)
 * (@phiegeeless)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/image-alignment-8/#post-1783111)
 * [http://www.sharpehairandbeauty.co.uk](http://www.sharpehairandbeauty.co.uk)
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/image-alignment-8/#post-1783117)
 *     ```
       #content {
       	margin: 0 100px 0 20px;
       }
       ```
   
 * find this style in style.css and set the right margin to 0 (zero), i.e. change
   the `100px` to `0px`
 * if this makes problems in other pages, then don’t make the change, and add a 
   new style after the one above:
    `.home #content { margin-right: 0px; }`

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

The topic ‘Image alignment’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 3 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [15 years, 5 months ago](https://wordpress.org/support/topic/image-alignment-8/#post-1783117)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
