简体   繁体   English

无法在Visual Studio中显示FontAwesome图标

[英]FontAwesome icons not displaying in VisualStudio

I have tried every variation of this code from FontAwesome and cannot get the icons to display: 我尝试了FontAwesome编写的此代码的所有变体,但无法显示图标:

http://prntscr.com/7jmy3y

I use Visual Studio 2013 for Web. 我将Visual Studio 2013用于Web。

@model HelloWorld.Models.Post
@{
    ViewBag.Title = "Delete";
}

<link rel="stylesheet" href="../../../Content/post.css">
<link rel="stylesheet" href="../../../Content/font-awesome.css">
<script src="../../../Content/js/jquery.js"></script>

<div class="create-post-form">
    <div class="form-group">
        <article class="post">
            <h4>@Html.DisplayFor(model => model.Title)</h4>
            <p>@Html.DisplayFor(model => model.Description)</p>
            <ul class="post-footer">
            <li><span id="comments"><i class="fa fa-comment"></i> 20</span></li>
            <li><span id="likes"><i class="fa fa-heart"></i> 5</span></li>
            </ul>
        </article>
</div>
</div>

I think the problem is in the fonts. 我认为问题出在字体上。 Refer this answer for an example. 请参考此答案作为示例。 What have I done? 我做了什么? This problem can be solve by using css file on remote server: 可以通过在远程服务器上使用css文件来解决此问题:

<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">

Sorry if this is late! 对不起,如果迟到了! :) :)

I experienced this problem, which I solved by adding manually through Visual Studio. 我遇到了此问题,可以通过在Visual Studio中手动添加来解决。 Follow this process: 请遵循以下过程:

  • Inside Visual Studio, inside a solution: Right-click ' Add ' > ' New folder ' 在Visual Studio中的解决方案中:右键单击“ 添加>新建文件夹
  • Right click ' Add ' > ' New Item ', then select all the items. 右键单击“ 添加>新项目 ”,然后选择所有项目。
  • Drag and drop the file where you want to use it. 将文件拖放到要使用的位置。

This should then work! 这样就可以了!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM