Support » Fixing WordPress » Image alignment/text wrapping problem

  • Resolved stgm


    Please take a look at my just-established blog:

    Under the most recent post, titled “Testing Image Alignment,” I have the following code:

    <p align="center"><img src="" />
    <i>America Express West Canadair Regional Jet.</i>

    The intent is for the image to be centered across the page, and the caption to appear underneath it, also centered. Obviously, it’s not working! Not to mention that the post underneath is starting to the right of that image in the first post.

    Here’s what I’ve tried so far:

    1. <p align="center">

    2. adding the following to the very end of my styles.css file:

    .center {
    text-align: center;
    margin-left: auto;
    margin-right: auto;

    … and adding “class=”center” in the <img src> tag, or by itself before the <img src> tag.

    So far, I’ve got nothing. I changed to a different theme, and the result was the same. I’m using WordPress 2.0.4, and Caffeine 0.2 theme.

    Any ideas? Thank you in advance for any help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • I would suggest using an image manager plugin – you can google for some.
    I use:

    I tried the ImageManager, with the same lack of results.

    Anyone? Help?

    Never mind, fixed it!

    I wish that WordPress would just align the images to the left or right by default. Most images in blogs are aligned in this way, that is to say wrapped. I have no difficulty inserting
    hspace=10 align=left or hspace=10 align=right into the “img” tag but my colleagues do. I don’t want to make them mess with a plug in either. If anywhere knows where the php code is that is generating the tag then please let me know so that I can hack it. If have searched for “img” in upload.php and upload-functions.php with no sucess.


    Another post tagged with alignment had the answer.

    Add the following to your theme’s style sheet (the file ending in .css). I put it right at the top.

    The first bit puts all images on the left, the second bit creates a class so that you can put them on the right occasionally.

    img {
    padding-right: 7px;

    img.right {
    padding-left: 7px;

    That way images will be automatically on the left and wrapped in text, unless you add “class=’right'” in the <img … /> tag in the editor.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Image alignment/text wrapping problem’ is closed to new replies.