我一直在使用entypo(从entypo.com下载),并显示如下图标:
.icon:before {
display: inline-block;
font-family: 'Entypo';
text-decoration: none;
speak: none;
}
.email:before {
content: "\2709";
}
很标准。但是由于从entypo.com下载提示时该提示已关闭,因此我已切换为从fontello下载。直到现在,我的CSS内容代码不再起作用。
我可以在演示中看到fontello使用如下跨度来调用html中的图标:
<span class="i-code">0xe829</span>
但这对我来说似乎很丑。我想从CSS做到这一点,但是如何找出要放入CSS的代码呢?
最佳答案
好的,所以我发现您要做的就是不使用fontello上提到的代码:
U+E84D
U+E854
但是将它们重写为:
\E84D
\E854
(因此,请删除“U +”,然后将其替换为“\”)
像这样使用它们:
content: "\E84D";
编辑:
因此,根据要求,您将使用的完整CSS语法为:
.icon:before {
display: inline-block;
font-family: 'Entypo';
text-decoration: none;
speak: none;
}
.email:before {
content: "\E84D";
}
结合以下HTML:
<a href="#" class="icon email">Mail me</a>