• The images I’m inserting into this theme are set to CENTER alignment. But when posts are published they’re aren’t centered. I checked the code and the wordpress css is intact:

    .aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto
    }

    But it doesn’t seem to be applying itself correctly to the div that the image is in <div id=attachment_6″>. I think the issue is that this div isn’t as wide as the content area. I can’t find css for attachment_6.

    Help!

Viewing 6 replies - 1 through 6 (of 6 total)
  • without a link to your site, there is not much advice to give.

    is there a class="wp-caption aligncenter" in the code as well?

    you may need to add a style to style.css for:

    .wp-caption.aligncenter {display: block;
    margin-left: auto;
    margin-right: auto
    }

    (also .wp-caption.alignleft {} and .wp-caption.alignright {} )

    Thread Starter grizzarkhov

    (@grizzarkhov)

    OMG! Life saver! Thank you. That was near making me crazy. *sigh*

    Okay, i’ve searched the forums and nothing i’ve seen so far works for my blog. Word press is so different from blogger. I am new to word press and to css so please be patient. I can not get images to center now either. Tell me what i’m doing wrong. Let me know any other info you need and i’ll post it.

    see example here https://www.amomsrantings.com/posts/wholly-guacamole/

    amomsrantings, you need to add this to your styles.css

    .aligncenter, div.aligncenter {
    	display: block;
    	margin-left: auto;
    	margin-right: auto;
    }

    I use:

    .aligncenter {
    	margin: 0 auto;
    	display: block;
    }

    I use this for my website at intenseblog:

    .aligncenter, div.aligncenter {
    	display: block!important;
    	margin: 20px auto;
    }

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Can’t get images to center’ is closed to new replies.