21

方法はわかりませんが、Twitterブートストラップグリフィコンを追加して、以下のCSSファイルの画像参照を置き換えたいと思います。

.edit-button {
  background: url('../img/edit.png') no-repeat;
  width: 16px;
  height: 16px;
}

HTMLでは、次のように追加します。

<i class="icon-search icon-white"></i>

何か案は?

更新-Firefoxのfirebugでは幅と高さしか表示されませんが、次のことを試しました。

.edit-button
{
  /* background: url('../img/edit.png') no-repeat; */
  background: url(../img/glyphicons-halflings.png) no repeat -96px -72px !important;
  width: 16px;
  height: 16px;
}

なぜそれが拾われていないのか分かりませんか?

4

2 に答える 2

109

:afterまたは:beforeメソッドを使用するのが好きです...

HTML

<a href="http://glyphicons.com/" class="arrow">Click Here</a></div>

CSS

.arrow:after {
  font-family: "Glyphicons Halflings";
  content: "\e080";
}

これは、グリフィコンフォントがある場合に機能するはずです(ブートストラップで無料で提供されます)

于 2014-02-26T16:27:48.530 に答える
2

では、編集ボタン<i>にタグを使用してみませんか?これを試して:

<button type="submit" name="edit" class="edit-button btn btn-primary">
   <i class="icon icon-edit icon-white"></i>
   Edit
</button>
于 2013-01-09T15:47:51.520 に答える