2

当元素位于父元素的底部时,如何使段落文本环绕图像或任何其他元素?

标记:

<div class='post'>
   <p class='post-content'>
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque imperdiet
      condimentum pulvinar. Pellentesque mattis fringilla dui, sit amet adipiscing augue
      elementum eget. Fusce ut dapibus neque. Quisque mattis lectus ac justo euismod
      luctus. Donec auctor volutpat rhoncus. Duis lacinia sodales sem ut placerat. Donec
      sodales, urna vitae dapibus mattis, turpis velit bibendum enim, in auctor elit neque
      in augue.

      <img src="" style="width:5em; height:5em; float:right;"/>
   </p>
</div>

请假设文本和图像在父 div 中。我想如果你可以将一个元素浮动到右侧和底部会很容易。

我希望它看起来像什么:

Lorem ipsum dolor sit amet, consecteturadipiscing elit. Quisque imperdiet
condimentum pulvinar. Pellentesquemattis fringilla dui, sitametadipiscing augue
elementum eget. Fusce ut dapibus neque.Quisque mattis lectus ac justo euismod
luctus. Donec auctor volutpat rhoncus. ______________________________________
Duis lacinia sodales sem ut placerat.  |                                     |
Donec sodales, urna vitae dapibus      |                                     |
mattis, turpis velit bibendum enim,    |                                     |
in auctor elit nequein augue.          |                the image            |
text text asjdjaskd asjkdh aks asdj    |                                     |
sahdahd jas asjksj haskdhsjad sjj      |                                     |
alsja asdajdkj j sjjakks asj h h gs    |                                     |
sss the text is wrapped here text t    |_____________________________________|

有任何想法吗?

4

1 回答 1

-1

Use CSS:

align

In the img tag, see this example image-text-wrap-css-html

于 2013-04-01T14:37:02.367 回答