新手问题 rails 中 link_to 的字符如何改变颜色

542307299 · August 05, 2013 · Last by chunlea replied at August 07, 2013 · 3581 hits

rails 中 link_to 的字符如何改变颜色

<%= link_to "my test", :controller => 'test', :action => 'test' %> 默认颜色是蓝色的,想要改成白色的,哪位知道怎么改

那个是 css 问题

你是说编辑器还是浏览器?编辑器是你主题的问题 浏览器是 css 的问题

在网上找到答案了,是这个<%= link_to "my test", {:controller => 'test', :action => 'test'},:style=>"color:red" %>

#3 楼 @542307299 直接在 html 写样式是不推荐的,刚开始学可以用用,后面还是要学习下 CSS 的知识。

在网上找到答案了,是这个<%= link_to "my test", {:controller => 'test', :action => 'test'},:style=>"color:red" %>

#4 楼 @edgar_wang_cn 恩呢,谢谢啊

第一时间想到了class: :link

#6 楼 @chunlea class::link 是做什么用的?也能修改颜色吗

#7 楼 @542307299 生成的代码是<a class="link">

You need to Sign in before reply, if you don't have an account, please Sign up first.