我有这个 HTML 代码。
我需要在文本的右上角可视化图像。我无法在第一段之前移动包含图像的 DIV 并应用 float
。
我的目标是将图像与文本一起显示在顶部,但将图像的 HTML 代码留在页面最后(SEO 原因)。
知道如何解决吗?谢谢
<div>
<p>some text here</p>
<p>some text here</p>
<p>some text here</p>
<p>some text here</p>
<p>some text here</p>
<div>
<img src="img.gif" alt="My Image" />
</div>
</div>
some text here +----+
some text here |img |
some text here +----+
some text here
some text here
PS:文本的长度可以是可变的。
最佳答案
你可以尝试这样的事情:
关于Css 以 SEO 友好的方式将图像定位在文本的一侧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7443647/