新手问题 rails 里面怎么加入 max-width 属性

nicetyler · 2017年07月10日 · 最后由 nicetyler 回复于 2017年07月13日 · 1358 次阅读

<%= link_to image_tag("product-2.jpg",alt:"product-1",class: "img-responsive" ),"#" %> 怎么在这个里面加 max-width 属性

link_to(body, url, html_options = {}),html_options 增加 style: “max-width:xxxpx”

link_to image_tag(...), '#', style: 'max-width: 100px;'

为啥不能用 css 写?

robertyu 回复

好的谢谢

msg7086 回复

谢了,就这样写了

cqcn1991 回复

在 css 文件里面写要加一个类

需要 登录 后方可回复, 如果你还没有账号请 注册新账号