有一个问题Use Font Awesome Icons in CSS,该代码在我的本地环境中有效。但是我无法在jsfiddle
中重现它。它只显示一个空白方块。
这是我的代码。
<div class="icon-bg">
Text
</div>
.icon-bg {
position: relative;
padding-left: 20px;
}
.icon-bg::before {
content: "\f0dd";
font-family: "Font Awesome 5 Free";
font-weight: 900;
left: 0px;
position: absolute;
top: 0;
}
我从https://cdnjs.com/libraries/font-awesome导入了all.min.css
CDN。
代码\f0dd
来自an official list。
This is the code在jsfiddle中。