0
私は以下のCSSクラスを持っています。クラス=>:我々はに苦戦.button.details、.button.details、.buttonいくつかのCSSクラスを含めることができる方法:複数のネストされたCSSクラスを.erbファイルに含めるにはどうすればいいですか?
.button {
display: block;
float: left;
line-height: 25px;
height: 33px;
padding-left: 10px;
text-decoration: none;
margin: 0.375em;
text-align: center;
}
.button elong {
display: block;
padding: 4px 10px 4px 0;
min-width: 95px;
}
.button.details { background: url(button_turquoise.gif) -290px -152px no-repeat scroll; color: #333333; text-shadow: 0 1px 0px #c6faff;}
.button.details elong { background: url(button_turquoise.gif) 100% 0px no-repeat; }
私.erbファイルには、以下の
<td> <%= link_to 'Show', {:action => 'show', :id => book.id, :method => :get}, {:class => 'button details elong'}-%></td>
私の質問があります'class1 class2 ...'。
上記は機能しません。
ありがとうございました
それはある程度まで働いていました。ボタンは左に切り捨てられているように見えました。同じ行の別の質問: ".button.details"と ".button.details elong"の違いは?.detailsとelongの間にスペースがあり、 'dot'ではありません。 – user1218003
クラス間のスペースはオプションです。それがクラスであれば、常に接頭辞をつけるべきです。 elongはクラスなので、その前にドットがあるはずです。 – Gazler