css - 如何更改 icomoon 图标的图标颜色

标签 css html icons

我已经从icomoom 下载了一些图标。但是图标背景颜色是黑色和白色。我想给自己的颜色。任何人都可以告诉我该怎么做吗?

当我下载图标时,我得到了以下style.css

@font-face {
    font-family: 'icomoon';
    src:url('fonts/icomoon.eot?-haa506');
    src:url('fonts/icomoon.eot?#iefix-haa506') format('embedded-opentype'),
        url('fonts/icomoon.woff?-haa506') format('woff'),
        url('fonts/icomoon.ttf?-haa506') format('truetype'),
        url('fonts/icomoon.svg?-haa506#icomoon') format('svg');
    font-weight: normal;
    font-style: normal;
}

[class^="icon-"], [class*=" icon-"] {
    font-family: 'icomoon';
    speak: none;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;

    /* Better Font Rendering =========== */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.icon-home:before {
    content: "\e600";
}
.icon-images:before {
    content: "\e601";
}
.icon-pawn:before {
    content: "\e602";
}

最佳答案

图标应被视为文本。

如果你给它们涂上颜色。它们会改变颜色。

例子:

.icon-pawn { color: red; }

关于css - 如何更改 icomoon 图标的图标颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21661087/

相关文章:

c# - 在 IIS 7.5 中部署的 MVC4 中的 CSS 中的背景图像 "Failed to load url"

php - 使用 php 和 mysql 的登录页面

java - 在java中的窗体上显示图标

javascript - 使用计时器更改类中所有 <div> 的 CSS 样式

css - 自定义 ActiveAdmin::FormBuilder(制作不同的部分)

html - 如何将两个div并排放置?

javascript - 遍历 table > tr > td > div 下的每个跨度

css - 无序列表不在 DIV 中居中。

c++ - 使用系统设置图标

python - 使用py2exe在.exe中嵌入图标,在Vista中可见?