次のCSSクラスがあります。
.table-price-item {
vertical-align: middle;
margin-bottom: 10px;
font-size: 0.875em;
padding-right: 5px;
}
そして、simple_forms の次の入力:
<%= f.input :price, :input_html => { :class => "table-price-item" },
:label => false, :as => :string, :readonly => true %>
フォームがレンダリングされると、これが得られます
<input class="string optional readonly table-price-item" ...
table-price-item は、次のように上書きされているため適用されません。
textarea, input[type="text"], input[type="password"], input[type="datetime"],
input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"],
input[type="week"], input[type="number"], input[type="email"], input[type="url"],
input[type="search"], input[type="tel"], input[type="color"], .uneditable-input
ブートストラップから。最後のものをオーバーライドするにはどうすればよいですか?
ところで、table-price-item は、そのフォームの select2 およびその他のアイテムにも適用されます。
css がリンクされる順序:
<link href="/assets/bootstrap.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/select2.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/application.css?body=1" media="screen" rel="stylesheet" type="text/css" />