【问题标题】:Changing the look of fields in rails using css使用 css 更改 rails 中字段的外观
【发布时间】:2011-08-03 00:21:31
【问题描述】:

在标准 html 页面上,我知道如何更改输入的外观,但在 Rails 上,我的输入结构类似于

<div class="field">
  <%= f.label :name %><br/>
  <span style="color:red;font-weight: normal; font-size:11px; "><%= errors_for(:name, @user) %> </span>
  <%= f.text_field :name %>      
</div>

它们像普通字段一样显示在浏览器中。如何使用css让它看起来像本页顶部的搜索栏http://kb.worldsecuresystems.com/tutorials/(边缘略圆,1px#999笔画,更大尺寸)谢谢

【问题讨论】:

    标签: ruby-on-rails css ruby html input


    【解决方案1】:

    您需要将 CSS 应用到实际的 &lt;input&gt;

    .field input {
        color: #999;
        font-weight: bold;
        font-size: 24px;
        padding: 10px;
        border: 2px solid #999;
        border-radius:2px;
    }
    

    See it on jsFiddle

    【讨论】:

      猜你喜欢
      • 2010-10-27
      • 2010-09-11
      • 1970-01-01
      • 2015-08-09
      • 1970-01-01
      • 2011-01-08
      • 1970-01-01
      • 2010-12-16
      • 1970-01-01
      相关资源
      最近更新 更多