Set border color to glyphicon

▼魔方 西西 提交于 2019-12-05 03:24:23

Basically the glyphicon icons are fonts and you can change the color of them just with the css color property. So, changing the color of the font, you will change the background. Now, fonts have no border-color property, but you can simulate it using text-shadow

.glyphicon{
    font-size: 60px;
    color:red;
    text-shadow: -2px 0 black, 0 2px black, 2px 0 black, 0 -2px black;
}

http://jsfiddle.net/9suc171t/1/

You could create two icons, one smaller than the other, and place the bigger one underneath. This could be a way:

<span class="glyphicon glyphicon-heart">
    <span class="inside glyphicon glyphicon-heart"></span>
</span>

CSS

span{
    font-size: 60px;
    color:red; 
}

span.inside{
    position:absolute;
    font-size: 55px;
    color:black;
    left:3px;
    top:2px;
}

Here a Demo

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!