微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在CSS中使用Twitter Bootstrap glyphicons

我想添加一个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;
}

不知道为什么它不被拾起?

解决方法

那么为什么不使用< i>你的编辑按钮的标签?尝试这个:
<button type="submit" name="edit" class="edit-button btn btn-primary">
   <i class="icon icon-edit icon-white"></i>
   Edit
</button>

原文地址:https://www.jb51.cc/css/217141.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。