WordPress.org

Ready to get started?Download WordPress

Forums

Image alignment not working correctly (6 posts)

  1. koreabeat
    Member
    Posted 6 years ago #

    Whenever I put an image into a post it will look fine in the WordPress editor but then always appear to be aligned to the left side when published. I've searched through the forums and read the documentation Wrapping Text Around Images, to no avail. You can see it happen in this post, and the source for the image, which is clearly supposed to be aligned right -- and appears so in the editor -- but readers see it on the left. This happens in both IE and Firefox.

    <img src="http://www.sportsseoul.com/news/baseball/pro/070907/72_465249_2.jpg" class="right" height="234" width="291" />

    http://koreabeat.com/?p=285

  2. lorigreenberg
    Member
    Posted 5 years ago #

    Alignment is doing funny things for me. I know that I have one blog where the theme is the issue but now I'm having this issue on a blog where it hasn't been an issue before.

    My issue is that I ask for right alignment but my picture is on the left and the text is not wrapping properly. Last week it worked fine, as you can see.

    http://gal-lori.com is the site (brightside theme). I upgraded to 2.6. Is that maybe the issue?

    My other site http://watchmecreate.com is defaulting to left alignment but I don't know if that is a theme thing (oh so very theme) or not, as it's a new one for me.

  3. ukalex
    Member
    Posted 5 years ago #

    I am having the same problem.

    You need to edit your themes CSS code, I do also but have been unsuccessful so far :(

    See 9. here http://wordpress.org/support/topic/164999

    * If someone could please help me alter my code, that'd be awesome...see http://wordpress.org/support/topic/190611

  4. Anonymous
    Unregistered
    Posted 5 years ago #

    Hi,
    I was having the same problem.. where if I placed an image on the post and set it to "align" left so that the text wrapped around the right, but even though the preview looked correct, once I saved and refreshed the site, it still looked incorrect.

    I was able to fix it by altering the style.css. this is how I did it:

    - look for the code that indicates the image alignment..(usually at the top of the code after body) and look for something like this:

    img.right
    {
    float:right;
    margin:0 0 1em 1em;
    }
    img.left
    {
    float:left;
    margin:0 1em 1em 0;
    }

    add the word "align" to the name, and it should fix the problem..
    so this should be the new code:

    img.alignright
    {
    float:right;
    margin:0 0 1em 1em;
    }
    img.alignleft
    {
    float:left;
    margin:0 1em 1em 0;
    }

    Based on your skin code, you may not find the same naming conventions, but just try doing a search within your page and look for .right and change it to .alignright

    hope that helps!

  5. lorigreenberg
    Member
    Posted 5 years ago #

    Thanks Shado. That worked.

    My css was already set to:

    img.float-right {
    margin: 5px 0px 5px 15px;
    }
    img.float-left {
    margin: 5px 15px 5px 0px;
    }

    But the float didn't matter...I needed align in there, like you said!

  6. Anonymous
    Unregistered
    Posted 5 years ago #

    glad to help! :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags