如果图片与侧面对齐,请在图片下方移动文字

问题描述 投票:7回答:1

我有图像和文字。图像向左对齐,因为我希望文本在图像旁边。图像和文字都在<p></p>中。

现在。我想插入在前面的文字和图片下显示的其他文字。

这该怎么做?

一些代码:

<p><img src="image.gif" align="left" width="300" height="200"> Good paragraph of text</p>
<p>Text that I want to appear below the text and the image above</p>
html css alignment
1个回答
13
投票

最简单的解决方案是将CSS样式属性添加到第二个p,如:

<p style="clear: both;">
© www.soinside.com 2019 - 2024. All rights reserved.