如何正确更改Fontello图标颜色而不更改CSS中的背景 [英] How do you properly change a Fontello icon color without changing the background in CSS

查看:280
本文介绍了如何正确更改Fontello图标颜色而不更改CSS中的背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Iv看着每一个地方,大多数人都在改变背景:p有什么办法,我可以改变颜色,不改变背景?感谢很多,例子会很高兴:)))

Iv looked every where and most people are changing the backgrounds first :p is there any way I could change the color straight away without changing the background ? Thanks a lot, examples will be gladly appreciated :)))

推荐答案

只需在CSS上使用颜色示例:

Just use "color" on your CSS. Sample :

<div>
<i class="icon-5x icon-search red"></i>
</div>

<div>
<i class="icon-5x icon-search green"></i>
</div>

<div>
<i class="icon-5x icon-search blue"></i>
</div>

然后为它着色:

   div {
    width:200px;
    height:80px;
    background: grey;
    margin-bottom: 6px;
}

i.icon-5x {
    display:block;
    text-align: center;
}

i.green {color:green}
i.blue {color:blue}
i.yellow {color:yellow}

最后:

DEMO

这篇关于如何正确更改Fontello图标颜色而不更改CSS中的背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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