html - 在 sass 中定义字体真棒内容时不显示
问题描述
因此,无论出于何种原因,我都无法让我的字体很棒的内容项目在我的.sass
文件中工作,我已经尝试了书中的每个选项。
这是wp_register_script
在 WP 中调用 Font Awesome 的原因:
wp_register_script(
'font-awesome',
'https://use.fontawesome.com/releases/v5.14.0/js/all.js',
[],
'5.14.0',
true
);
然后这里是我的&:after
假电话:
&:after
content: "\f105"
position: absolute
right: 30px
transition: all 0.5s
font-weight: 900
font-style: normal
我在实际网站内和实际网站上呈现的所有内容console
都只是一个黑匣子,我希望能够显示>
箭头。
所有帮助将不胜感激!
解决方案
您需要为 :after 伪元素指定字体系列,还可能需要 - display: block 或 display: inline-block 以允许它呈现...
而且 - 由于您将其设置为 position: absolute - - 您需要将其父元素设置为 position: relative 以允许正确定位....
.menu-list s span {
position: relative; // added this - to allow absolute poisitioning of the icon within the span.
}
&:after {
content: "\f105",
position: absolute,
right: 30px,
transition: all 0.5s,
font-weight: 900,
font-style: normal,
font-family: FontAwesome, // added this line
display: block, // added this line
...
}
推荐阅读
- java - 到 SampleObject(一些 POJO)的扁平字符串消息
- javascript - 如何从 json 数组中打印大量项目
- python - 寻找 Flask 的设计模式 - SQLAlchemy 缓存和/或分页
- php - Symfony 锁组件允许在不释放之前的作业锁的情况下执行相同的 cron
- javascript - 使用 Array.from() 或 insertAdjacentElement 意外更改属性值
- android - 需要帮助为我的 gps (NEO 6m) 和 arduino 创建自定义应用程序
- android - 如何订阅 Firebase 消息频道
- postgresql - 我们如何将 postgres 数据库的管道设置为 neo4j 数据库?
- android - 为什么我在 react native 中的组件在组件状态发生变化后没有被重新渲染?
- rundeck - 我在哪里可以找到 Rundeck SCM 配置?