Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Talk:Wrapping Text Around Images

I think this caption display code is confusing because it will only work if you want your caption to be 45px wide:

.caption { margin: 5px;

    padding: 5px; 
    width: 45px; 
    border: solid 1px #E5E5FF; 
    background: #E5F2FF; 
    font-size:90%; 
    color: black }

I'd much prefer if there was css code that allowed it to adjust the caption display width to the width of the image. After all, what if the image is 225px wide & you use this css which makes the caption 45px wide. Pretty weird.Richards1052 08:22, 14 Jun 2005 (UTC)

Good catch. That was left over from the example of the flower and not adjusted for any width. Lorelle 13:20, 14 Jun 2005 (UTC)

Okay, I think I've got the page pretty much organized. The examples section still needs to be cleaned up, though.

--AniM 20:17, 26 Jul 2005 (UTC)

The whole tutorial is only good if people are not using IE. When wrapping text around a picture inside a post, using the provided code, the image is blank in IE. It works fine in Fire Fox, however, we all know most people use IE. I have not found a solution to this problem.

--Brian Bonner 17:55, 3 Dec 2005 (GMT)

I have figured it out! It was so simple I can't believe it took me this long. you have to add position: relative; to the css. Example:

img.right { position: relative; padding: 4px; margin: 0 0 2px 7px; display: inline; }

img.left { position: relative; padding: 4px; margin: 0 7px 2px 0; display: inline; }

--Brian Bonner 20:29, 3 Dec 2005 (GMT)

Using class="left" or class="right", my images were invisible in IE6. By adding position: relative; to the css the problem went away.

testing with WordPress v4.9.5

The instructions here regarding image formatting in the CSS don't seem to work with WordPress v4.9.5 using the default built-in themes twentyseventeen or twentysixteen. Modifying the img entry in the CSS doesn't seem to have any effect.