WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Image alignment/text wrapping problem (7 posts)

  1. stgm
    Member
    Posted 7 years ago #

    Please take a look at my just-established blog:

    http://www.sbaapproaches.com

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

    <p align="center"><img src="http://www.sbaapproaches.com/hosted/2004-02-05_DR_06501_america-west-express_560x.jpg" />
    <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.

  2. Samuel B
    moderator
    Posted 7 years ago #

    I would suggest using an image manager plugin - you can google for some.
    I use:
    http://www.soderlind.no/archives/2006/01/03/imagemanager-20/

  3. stgm
    Member
    Posted 7 years ago #

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

  4. stgm
    Member
    Posted 7 years ago #

    Anyone? Help?

  5. stgm
    Member
    Posted 7 years ago #

    Never mind, fixed it!

  6. timtak
    Member
    Posted 7 years ago #

    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.

    Tim

  7. timtak
    Member
    Posted 7 years ago #

    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 {
    float:left;
    padding-right: 7px;
    }

    img.right {
    float: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.

Topic Closed

This topic has been closed to new replies.

About this Topic