via css书签,Unicode via CSS :before
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I am using Font Awesome on my webpage and I want to display an icon inside the :before pseudo element.
According to the documentation/cheatsheet, I have to type to get this font, but it isn't working. I believe that is normal because HTML entities aren't supported in :before.
So I googled a bit and found out, that if you want to display HTML entities in :before, you have to use the escaped hex reference.
So I was searching for the hex reference to but I found nothing. I believe that is because these are "private use" values, whatever that means.
Is there any way to get it working in :before?
回答1:
The escaped hex reference of is \f066.
content: "\f066";
回答2:
In CSS, FontAwesome unicode works only when the correct font family is declared (version 4 or less):
总结
以上是生活随笔为你收集整理的via css书签,Unicode via CSS :before的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: 2022年6月总结
- 下一篇: CSS边界样式 (背景、边框)