红宝石大虾如何在对齐的右图像周围环绕文字?

发布于 2024-08-18 09:17:27 字数 152 浏览 5 评论 0原文

是否可以使用 float:right 属性将图像向右对齐并将文本环绕在图像周围,就像在 html 和 css 中一样?

如果是这样,你该怎么做?

我可以对齐图像,但不知道如何将文本环绕在图像周围。文本是动态文本,因此长度变化很大。

多谢 瑞克

s it posible to align an image to the right and wrap text around the image like it is in html and css using the float:right property ?

If so how do you do this ?

I can align an image but dont't know how to wrap the text around it. The text is dynamic text therefore varies alot in length.

Thanks alot
Rick

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

伪装你 2024-08-25 09:17:27

一种建议是尝试嵌套边界框。主边界框内将包含文本。在某个时刻图像的另一个边界框。您

bounding_box([x,y], :width => bounds.width, :height => 400) do
    text "blah"
    text "blah"
    # image
    bounding_box([bounds.right - image_width, 0], :width => image_width) do
          image("path_to_file", :at => [0,0], :width =>  bounds)
    text "more blah"


end

可能可以简单地使用没有边界框的图像,但边界框将确保文本在其周围流动。

One suggestion is to try nested bounding boxes. The main bounding box would have the text inside it. with at some point another bounding box for the image. Something along the lines of

bounding_box([x,y], :width => bounds.width, :height => 400) do
    text "blah"
    text "blah"
    # image
    bounding_box([bounds.right - image_width, 0], :width => image_width) do
          image("path_to_file", :at => [0,0], :width =>  bounds)
    text "more blah"


end

You may be able to simply use the image without the bounding box, but the bounding box would ensure that the text flows around it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文