Forums

Text not wrapping around image (3 posts)

  1. kathleane
    Member
    Posted 3 years ago #

    I'm trying to add an image to a page that will align to the left of the page with text wrapped to the right of the image and a small margin of white space between the image and the text. Below is the code I've used (I apologize that it's such a mess but I keep trying different things from other posts in this forum and I've probably added way too much code).

    <img class="size-full wp-image-3 style="float: right" margin-right: 5px title="Sitters Unlimited babysitter caregiver with children" src="http://www.socasittersunlimited.com/wp-content/uploads/2008/08/img1.jpg" alt="" width="193" height="295" />

    Does anyone have any ideas how I can make this work?

  2. moshu
    Member
    Posted 3 years ago #

    You should probably use a class, like "alignright" and define that class in the stylesheet as float: right.

    When you select during the process of adding an image to be positioned "right" WP will add the class="alignright" to it. Therefore, it is not by accident that in the new ...extend/themes there is a requirement to have those 3 classes (left,center, right - see 2.d)

    I'd suggest you also go that way: no need to manually add the class to the image code, WP will do it, and you just define those classes once in the style.css.

  3. Lillith Avalon
    Member
    Posted 3 years ago #

    I just fixed two different themes where text wasn't wrapping around images nicely.

    The solution for me was to add code to the .css sheet so that the native alignleft and alignright img classes worked properly.

    Here is the info I used to fix my problem...

    http://codex.wordpress.org/Wrapping_Text_Around_Images

Topic Closed

This topic has been closed to new replies.

About this Topic