将边框颜色设置为glyphicon [英] Set border color to glyphicon

查看:108
本文介绍了将边框颜色设置为glyphicon的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为glyphicon字体添加边框。例如, glyphicon-heart 具有红色边框和与背景相同的颜色。我该怎么做?

I want to add a border to glyphicon font. For example, glyphicon-heart that has a red border and same color as the background. How can I do this?

边框颜色:红色 没做。

推荐答案

glyphicon图标基本上是字体,您可以使用css更改它们的颜色 color 属性。因此,更改字体的颜色,您将更改背景。现在,字体没有 border-color 属性,但是您可以使用 text-shadow

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/

这篇关于将边框颜色设置为glyphicon的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆