4

Bootstrap を使用していますが、上書きするのが難しい場合があります。

ボタンのテキストの近くに画像を追加したいと思います。だから背景画像を追加しましたが、適用されません。

これが私のボタンのcssです:

 .submit .report{
font-size: 18px;
text-shadow: none;
font-weight: bold;
padding: 5px;
width:300px;
color:white;
filter:alpha(opacity=100);
background: #628d28;
background-image:url('../images/picture.png') no-repeat;
}

しかし、Firebug は、私の要素には次の CSS があると言っています。

  .submit .report{
font-size: 18px;
text-shadow: none;
font-weight: bold;
padding: 5px;
width:300px;
color:white;
filter:alpha(opacity=100);
background-image: none repeat color(98,141,40);

}

背景画像を追加できないのはなぜですか?

4

1 に答える 1

2

間違った背景プロパティを定義しました。このように書いてください:

.submit .report{
background-color: #628d28;
background-image:url('../images/picture.png');
background-repeat:no-repeat;
}

また

.submit .report{
    background: #628d28 url('../images/picture.png') no-repeat;
 }
于 2012-08-28T11:00:01.087 に答える