如何在JSFiddle中使用FontAwesome图标作为背景

时间:2020-02-17 08:40:05

标签: font-awesome jsfiddle

有一个问题Use Font Awesome Icons in CSS,该代码在我的本地环境中有效。但是我无法在jsfiddle中重现它。它只显示一个空白方块。

这是我的代码。

HTML

<div class="icon-bg">
Text
</div>

CSS

.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中。

0 个答案:

没有答案
相关问题