我正在使用 Bootstrap glyphicon
类:
.glyphicon {
top: 1px;
//...
}
对于单个元素,我想覆盖 top
属性,与 CSS 内联:
<span class="glyphicon glyphicon-home" style="glyphicon.top:2px"></span>
我知道这不是标准方法,但您知道我要实现的目标。
这可能吗?
最佳答案
<span class="glyphicon glyphicon-home" style="position: relative; top:2px"></span>
CSS
定位属性(上/右/下/左)仅在与 relative
、absolute
或 fixed< 一起使用时有效
位置。
关于html - 如何覆盖外部类的内联 css?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37186576/