0

私はこれに1時間以上苦労しています。クラス「up」と「down」の画像をインラインで表示したい。私は何を見落としていますか?

display:inline も試しましたが、うまくいきません。参考になれば、Rails で Twitter ブートストラップも使用しています。

pages.css

  body {
  background-color: grey;
}




.up img {

  width: 30px;
  height:30px;
  padding: 5px 5px 5px 5px;
  display:inline-block;
}
.down img{
  width: 30px;
  height:30px;
  padding: 5px 5px 5px 5px;
  display:inline-block;
}

index.html.haml

  - title "Demociaki"
- for demot in @demots
  .demot
    = image_tag demot.photo.url
    %br
    .voting
      .up= link_to image_tag("up.jpeg"), vote_up_demot_path(demot), :method => :post
      .down= link_to image_tag('down.jpeg'), vote_down_demot_path(demot), :method => :post
      %h3= demot.votes_for
4

1 に答える 1

1

あるべきでimg.upあり、そうでimg.downはない。up imgdown img

.up imgクラスを持つ要素の下にあるすべてのimg要素を選択してい.upます。 タグが。img.upであるクラスを持つすべての要素を選択します。.upimg

于 2012-09-29T17:49:55.630 に答える