【问题标题】:Formtastic Submit Button Style with CSS带有 CSS 的 Formtastic 提交按钮样式
【发布时间】:2012-08-20 19:14:49
【问题描述】:

我需要一些关于表单提交按钮样式的帮助。

查看

<%= semantic_form_for @comment || NewsComment.new, :url => news_ncomments_url(@news) do |f| %>
   <%= f.inputs do %>
       <%= f.input :body, :label => false, :required => true %>
   <% end %>
   <%= f.actions do %>
       <%= f.action :submit, :label => "Kommentar absenden" %>
   <% end %>
<% end %>

css

#news_comment_submit_action {
    background: rgb(93,190,232);
    background: -moz-linear-gradient(top, rgb(93,190,232) 0%, rgb(53,156,218) 50%, rgb(35,141,211) 51%, rgb(34,139,207) 89%, rgb(32,131,196) 95%, rgb(32,131,196) 100%);
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgb(93,190,232)), color-stop(50%,rgb(53,156,218)), color-stop(51%,rgb(35,141,211)), color-stop(89%,rgb(34,139,207)), color-stop(95%,rgb(32,131,196)), color-stop(100%,rgb(32,131,196)));
    background: -webkit-linear-gradient(top, rgb(93,190,232) 0%,rgb(53,156,218) 50%,rgb(35,141,211) 51%,rgb(34,139,207) 89%,rgb(32,131,196) 95%,rgb(32,131,196) 100%);
    background: -o-linear-gradient(top, rgb(93,190,232) 0%,rgb(53,156,218) 50%,rgb(35,141,211) 51%,rgb(34,139,207) 89%,rgb(32,131,196) 95%,rgb(32,131,196) 100%);
    background: -ms-linear-gradient(top, rgb(93,190,232) 0%,rgb(53,156,218) 50%,rgb(35,141,211) 51%,rgb(34,139,207) 89%,rgb(32,131,196) 95%,rgb(32,131,196) 100%);
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#5dbee8', endColorstr='#2083c4',GradientType=0 );
    background: linear-gradient(top, rgb(93,190,232) 0%,rgb(53,156,218) 50%,rgb(35,141,211) 51%,rgb(34,139,207) 89%,rgb(32,131,196) 95%,rgb(32,131,196) 100%);text-decoration: underline;
    color: #fff;
    text-decoration: none;
    width: 134px;
    height:32px;
    padding: 5px;
    position: relative;
    display: block;
    left: -5px;
    margin-bottom: 12px;
    -webkit-box-shadow: 0 0 6px #999;
    -moz-box-shadow: 0 0 6px #999;
    box-shadow: 0 0 6px #999;
}

图片

http://img.i7x.de/i/PMkmqY/button_display_error.png

有谁知道如何禁用这个丑陋的灰色背景?

【问题讨论】:

  • 我没有看到灰色背景?你的意思是你想让圆角灰色渐变按钮的东西消失,只剩下蓝色方块?

标签: css ruby-on-rails ruby button formtastic


【解决方案1】:

您必须为按钮本身设置样式:

input[type="submit"] {
    background: transparent;
    border: 0;
}

您可能应该比input[type="submit"] 更具体,但您明白了。

在您的图片中,您似乎在设置按钮容器的样式,而不是按钮本身。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-01-22
    • 1970-01-01
    • 1970-01-01
    • 2011-04-22
    • 1970-01-01
    • 1970-01-01
    • 2010-09-25
    • 1970-01-01
    相关资源
    最近更新 更多