use*_*582 21 css image twitter-bootstrap glyphicons
我想添加一个Twitter bootstrap glyphicon来替换下面CSS文件中的图像引用,虽然不知道如何.
.edit-button {
background: url('../img/edit.png') no-repeat;
width: 16px;
height: 16px;
}
Run Code Online (Sandbox Code Playgroud)
在HTML中我会添加如下:
<i class="icon-search icon-white"></i>
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
更新 - 尝试以下虽然它只显示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;
}
Run Code Online (Sandbox Code Playgroud)
不知道为什么它没被拿起来?
小智 109
我喜欢使用:after或:before方法...
HTML
<a href="http://glyphicons.com/" class="arrow">Click Here</a></div>
Run Code Online (Sandbox Code Playgroud)
CSS
.arrow:after {
font-family: "Glyphicons Halflings";
content: "\e080";
}
Run Code Online (Sandbox Code Playgroud)
假设您有glyphicon字体(它们随Bootstrap免费提供),这应该可以工作
那么为什么不使用<i>标签作为编辑按钮呢?尝试这个:
<button type="submit" name="edit" class="edit-button btn btn-primary">
<i class="icon icon-edit icon-white"></i>
Edit
</button>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
61284 次 |
| 最近记录: |