我有一个奇怪的问题:我的一个 FontAwesome 图标没有显示,尽管 View 上的所有其他图标都可以工作。我不明白为什么。
<a class="add-img fa fa-plus-circle" title="@SharedResources.Index.Add" data-bind="click: mainDataAdd"></a>
- 我检查过图标的命名是否正确
- 尝试了另一个图标类,没有用
无论我在该链接中放置哪个图标,它都不会显示。
<tr class="actions-row" role="row">
<td class="header-action-row" style="border:none;" colspan="12">
<h6 class='datatable-title'><span class='fa fa-list'></span> @SharedResources.Index.SocialWorkerLog</h6>
<div class="action-images pull-right">
@{
Dictionary<string, string> reports = ReportManager.GetReportList(ReportLocations.ResidentActiviesAllMainGrid_Top.ToString());
if (reports.Count() == 1)
{
<a class="fa fa-print" title="@SharedResources.Index.Print" data-bind="click: function(){printreportSocial('@reports.First().Key',$data);}" style="color:#337ab7; cursor: pointer;"></a>
}
}
<a class="add-img fa fa-plus-circle" title="@SharedResources.Index.Add" data-bind="click: mainDataAdd"></a>
</div>
</td>
</tr>
最佳答案
您的代码已修复。使用下面链接的字体 Awesome CDN 并为 anchor 标记赋予颜色
a{
color:red;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css" />
<a class="add-img fa fa-plus-circle" title="@SharedResources.Index.Add" data-bind="click: mainDataAdd"></a>
关于html - FontAwesome 图标不可见,但适用于另一个相同的 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52252068/