私の画面は次のようになります。 同じ行のHTML、CSS上のすべての要素を取得する方法
は、私はすべてが同じ行になりたいです。これをどうやって解決するのですか?私のhtmlコード:
.form-box
%h3 Restrictions
%legend Restricted Locations
%fieldset.restrictions-row
.restrictions-row.restrictions-label
= label_tag :us_states, "US States"
.restrictions-row.restrictions-select
= collection_select :restriction, :category, Restriction.where(category: "US State"), :id, :name, prompt: true
= hidden_field_tag :product_id, @wine.product.id
= hidden_field_tag :restriction_category, "US State"
.restrictions-row
= button_tag "Add", class: 'btn btn-primary'
%table.table.table-hover.table-condensed.story-list.restrictions-row
%th{ style: 'padding: 3% 17%' } State
%th{ style: 'padding: 3% 17%'} Remove
私のCSS:
.restrictions-label {
width: 10%;
font-weight: bold;
}
.restrictions-select {
width: 10%;
}
.restrictions-row {
display: inline-block;
}
優先さを取っていますか?私がdivにそれを適用すると、ボーダーラインが動作しないのはなぜですか?
.restrictions-rowクラスはテーブル上にありますので、すでにインラインブロックで表示されているはずです。誰かがこのケースではオーバーライドを考えるかもしれませんが、それはテーブルに書かれた最後のクラスなので、デフォルトをオーバーライドする必要があります – necilAlbayrak