【发布时间】:2014-08-04 14:57:47
【问题描述】:
我有一个图像,我试图将其向下移动两个像素。这似乎很容易,但我不能完全正确地理解语法。下面是我的图片的代码。
= link_to("...with <img src='#{widget_logo_url}' border=0/>
Code", "http://website.net", :target => "_blank", :style => "margin-right:11px;")
我尝试了一些变体来移动这张图片,但它不起作用。这是我尝试过的:
= link_to("...with <img src='#{widget_logo_url}' border=0 margin-bottom:-2px/>
Code", "http://website.net", :target => "_blank", :style => "margin-right:11px;")
= link_to("...with <img src='#{widget_logo_url}' border=0 "margin-bottom:-2px">
Code", "http://website.net", :target => "_blank", :style => "margin-right:11px;")
= link_to("...with <img src='#{widget_logo_url}' border=0 margin-bottom:"-2px">
Code", "http://website.net", :target => "_blank", :style => "margin-right:11px;")
我查看了 link_to 参数并尝试修改 :style 标记,但它会将整个链接作为一个整体移动。一些帮助会很棒,因为我真的很想继续前进。谢谢。
【问题讨论】:
-
试用
link_to的块版本(在文档中显示)
标签: ruby-on-rails