使用css改变rails中字段的外观



在标准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描边,更大的尺寸)谢谢

您需要将CSS应用于实际的<input>

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

在jsFiddle上看到

最新更新