1

我在这里遇到了一个很小的基本问题。我有一张图片和很多文字。我希望我的图像占据它的空间,然后剩余的空间应该用文本填充,也是图像右侧的空间。但是,文本总是从图像结束的下一行开始。这是代码。

<p style="float:left;">
  <img src="http://upload.wikimedia.org/wikipedia/commons/b/b1/Maria_Amalia.jpg" />
Princess Maria Amélia of Brazil (1831–1853) was the daughter of Dom Pedro I, founder of Brazil's independence and here continues my text...</p>

jssfiddle:http: //jsfiddle.net/xpncr/

4

1 回答 1

4

你想把float: left你的形象。

<p>
    <img src="http://upload.wikimedia.org/wikipedia/commons/b/b1/Maria_Amalia.jpg" style="float: left;" />
    Princess Maria Amélia of Brazil (1831–1853) was the daughter of Dom Pedro I, founder of Brazil's independence and
</p> 

jsfiddle:http: //jsfiddle.net/xpncr/1/

于 2012-12-02T09:47:54.700 回答