Rails 3.1 simple_form提交样式css
你好,有人知道如何为 css 样式添加一个类到 simple_form 提交按钮吗?这是我尝试做的:
_form.html.erb
<%= simple_form_for(@drink) do |f| %>
<%= f.submit "Add drink",:input_html =>{:class => "create"} %>
<%end%>
drinks.css.scss
.create {
background-color:#2fd62f;
-moz-border-radius:4px;
-webkit-border-radius:4px;
border-radius:4px;
border:1px solid #dcdcdc;
display:inline-block;
color:#fafafa;
font-family:arial;
font-size:12px;
font-weight:bold;
padding:7px 24px;
text-decoration:none;
text-shadow:0px 0px 0px #70706f;
}.create:hover {
background-color:#2fbf0f;
}.create:active {
position:relative;
top:1px;
}
Hello did anybody know how to add a class to a simple_form submit button, for css style.Here's what I try to do:
_form.html.erb
<%= simple_form_for(@drink) do |f| %>
<%= f.submit "Add drink",:input_html =>{:class => "create"} %>
<%end%>
drinks.css.scss
.create {
background-color:#2fd62f;
-moz-border-radius:4px;
-webkit-border-radius:4px;
border-radius:4px;
border:1px solid #dcdcdc;
display:inline-block;
color:#fafafa;
font-family:arial;
font-size:12px;
font-weight:bold;
padding:7px 24px;
text-decoration:none;
text-shadow:0px 0px 0px #70706f;
}.create:hover {
background-color:#2fbf0f;
}.create:active {
position:relative;
top:1px;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
<%= f.submit "添加饮料", :class =>; “创建”%>
<%= f.submit "Add drink", :class => "create" %>
在 Rails 5 中执行以下操作
In rails 5 do the following