[英]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 %>
您在样式图像上的包装器链接,而不是图像本身。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.