我上传了一个svg到Icomoon,这样它就可以生成icofonts了。它是一个多色的icofont,有9个不同的路径在css文件中。
这个icofont的代码在我的css中如下所示:
.icon-accordance_logo {
font-size:5em
}
.icon-accordance_logo .path1:before {
content: "\e900";
color: rgb(7, 59, 75);
}
.icon-accordance_logo .path2:before {
content: "\e901";
margin-left: -1.0498046875em;
color: rgb(7, 59, 75);
}
.icon-accordance_logo .path3:before {
content: "\e902";
margin-left: -1.0498046875em;
color: rgb(7, 59, 75);
}
.icon-accordance_logo .path4:before {
content: "\e903";
margin-left: -1.0498046875em;
color: rgb(7, 59, 75);
}
.icon-accordance_logo .path5:before {
content: "\e904";
margin-left: -1.0498046875em;
color: rgb(7, 59, 75);
}
.icon-accordance_logo .path6:before {
content: "\e905";
margin-left: -1.0498046875em;
color: rgb(7, 59, 75);
}
.icon-accordance_logo .path7:before {
content: "\e906";
margin-left: -1.0498046875em;
color: rgb(233, 72, 112);
}
.icon-accordance_logo .path8:before {
content: "\e907";
margin-left: -1.0498046875em;
color: rgb(22, 139, 179);
}
.icon-accordance_logo .path9:before {
content: "\e908";
margin-left: -1.0498046875em;
color: rgb(81, 183, 149);
}
.icon-accordance_logo .path10:before {
content: "\e909";
margin-left: -1.0498046875em;
color: rgb(254, 209, 104);
}我想用这个icofont页面背景。这是我正在使用的代码:
body:after{
font-family: icomoon;
content: "\e900"; //This is the issue
font-size: 20em;
text-shadow: 2px 2px #ff0000;
z-index:10000;
} 内容属性仅来自一条路径。我如何插入所有其他路径,以及它是否有可能?因为我知道如果使用这个twitter图标:
.icon-twitter:before {
content: "\e600";
}然后将其用作页面背景,其内容如下:
body:after{
font-family: icomoon;
content: "\e600";
font-size: 20em;
text-shadow: 2px 2px #ff0000;
z-index:10000;
}效果很好。那么,如何使多路径的多色icofont作为页面背景工作呢?
布拉格兹岛
发布于 2016-09-18 13:39:29
1)当你只有3种颜色时,你不应该有9条路!
2)通过加入所有的rgb(7, 59, 75);,您应该只有3个路径
3) 每个路径是一个字形(“字母”)。但是你只能使用两种颜色,而不是三种颜色。
在这里看到我的答案,它包含了一个工作演示:https://stackoverflow.com/a/39557217/1008547
当你真的想要3种颜色的时候,你可以想出一个额外的元素作为身体的第一个子元素。
position: fixed;
pointer-events: none;顺便说一句:你的z-index: 1000;相当糟糕。
https://stackoverflow.com/questions/38810566
复制相似问题