在div / iframe / image周围环绕文本

时间:2013-08-29 05:25:55

标签: html css text formatting wrapping

我需要在div周围包含一些文本(包含infogr.am的iframe)。这是我现在的代码:

BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH 

<div align="right" padding-left="1px" width="250" height="500" float="right">

  <iframe src="//e.infogr.am/-1684823382_1377121261" width="250" height="500"
  scrolling="no" frameborder="0" float="right"></iframe>

</div>
BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH 

但每次运行时,文本都会保留在infogr.am div的顶部和底部。我需要的是infogr.am div应该对齐并且文本应该环绕它(即在它的顶部,在它的左侧,在它下面)。 我究竟做错了什么?也许是绝对的定位?有什么建议吗?

1 个答案:

答案 0 :(得分:4)

试试这个:

<div style="float: right; width: 0px; height: 100px"></div>
<div style="float: right; clear: right"><iframe src="//e.infogr.am/-1684823382_1377121261" width="250" height="500"
  scrolling="no" frameborder="0" float="right"></iframe></div>
text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text texttext text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text texttext text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text texttext text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text

你可以看到它在这个小提琴中起作用:http://jsfiddle.net/7t8HR/

古德勒克