Viewing 3 replies - 1 through 3 (of 3 total)
  • Try wrapping the a tag and image portion in a div and give the image a margin: 0 auto; to center it.

    <div class="your-class"><a href="https://www.bodyworker.org/under-construction/yogafamilyonbeach/" rel="attachment wp-att-5"><img width="300" class="aligncenter size-medium wp-image-5" title="yogafamilyonbeach" src="https://www.bodyworker.org/wp-content/uploads/2011/08/yogafamilyonbeach-300x225.jpg" alt=""></a></div>

    I hope this helps!

    To center it you’d set the margin to this:

    margin: 0 auto;

    When you center an image in the WordPress editor, it adds a class to your image of aligncenter. So normally you’d use that class to center your images. But in your code you have a few other rules that are overriding that one, so you’ll need to change the rule with the highest authority.

    In your case it is a rule that you’re inserting in the head of the page. So you’ll need to find this and change it:

    #content img {
       border: 8px solid #797E83;
       margin: 0 10px 5px 0;
       -moz-border-radius: 20px;
    }

    Again this is inserted in the head of the document, with a comment saying Custom CSS styles defined in options. So that makes me think it’s inserted via your theme options page, maybe? But you’ll need to change the above margin to be:

    margin: 0 auto 5px;

    and it should center.

    Thread Starter Deep Spring Farmer

    (@leelalove)

    Thank you so much for the responses. I went to Suffusion theme Custom Includes and changed the code to: margin: 0 auto 5px;

    It is now centered

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Images won't center’ is closed to new replies.