Font Awesome 在 cakephp 中不起作用?
Font Awesome not working In cakephp?
下面是我的代码。我为 cakephp 添加了很棒的字体。但在我的输出中 fontawesome 没有出现。
HTML
<i class="fa fa-institution"></i>
CSS
.fa {
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
transform: translate(0, 0);
}
.fa {
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
transform: translate(0, 0);
}
你在哪里给这个。在 html link 或按钮中。
检查你是否正确添加了 awesome 字体
如果你是link的意思
$this->Html->link("<i class='fa fa-users'></i>", [action here], ['escape' => false])
而且我也在为我的 cakphp 3 项目使用超棒的字体图标。它对我来说很好
我注意到的另一件事是您可能忘记复制 fonts 文件夹,它应该放在 webroot 目录中。因为,你确认它显示的是方框而不是图标,我建议你将 fonts 文件夹复制到正确的位置。
下面是我的代码。我为 cakephp 添加了很棒的字体。但在我的输出中 fontawesome 没有出现。
HTML
<i class="fa fa-institution"></i>
CSS
.fa {
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
transform: translate(0, 0);
}
.fa {
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
transform: translate(0, 0);
}
你在哪里给这个。在 html link 或按钮中。
检查你是否正确添加了 awesome 字体
如果你是link的意思
$this->Html->link("<i class='fa fa-users'></i>", [action here], ['escape' => false])
而且我也在为我的 cakphp 3 项目使用超棒的字体图标。它对我来说很好
我注意到的另一件事是您可能忘记复制 fonts 文件夹,它应该放在 webroot 目录中。因为,你确认它显示的是方框而不是图标,我建议你将 fonts 文件夹复制到正确的位置。