link_to image_tag in rails css 上的圆角
round corners on a link_to image_tag in rails css
我想在我的网站上对图片进行圆角处理,但我似乎找不到这样做的方法。
这是我现在的代码:
index.html.erb
<%= link_to image_tag("new(2).png", :size => "50x50"), example_path(@example, :id => example.id), :class =>'css-style', method: :post %>
application.css.scss
.css-style {
border-radius: .5em;
}
你需要这个:
<%= link_to image_tag("new(2).png", :size => "50x50", class: "css-style"), example_path(@example, :id => example.id), method: :post %>
您在图片上设置了包装 link 的样式,而不是图片本身。
我想在我的网站上对图片进行圆角处理,但我似乎找不到这样做的方法。 这是我现在的代码: index.html.erb
<%= link_to image_tag("new(2).png", :size => "50x50"), example_path(@example, :id => example.id), :class =>'css-style', method: :post %>
application.css.scss
.css-style {
border-radius: .5em;
}
你需要这个:
<%= link_to image_tag("new(2).png", :size => "50x50", class: "css-style"), example_path(@example, :id => example.id), method: :post %>
您在图片上设置了包装 link 的样式,而不是图片本身。