html - 在右对齐图标周围环绕文字?

标签 html css

是否可以制作一个小框(对我来说这将是列表中的行元素),右上角有一个图标,文字环绕在它周围?像这样的东西:

-------------------------------------------------
| Some text here which may wrap around  [icon]  |
| if it were to get too long, but then fit well |
| around the icon in the upper right corner?    |
-------------------------------------------------

我打算将其用作列表中的一行,用户可以单击右上角的图标删除该行。我可以使用

或 ,我不确定哪个更好?:

<div> 
  <p>The text</p>
  <img src="close.png" align="upper-right">
</div>

谢谢

最佳答案

听起来像是花车的工作。

<div> 
    <img src="close.png" style="float: right" />
    <p>The text</p>
</div>

关于html - 在右对齐图标周围环绕文字?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2954769/