字体未在MVC上加载。

时间:2018-07-19 17:21:10

标签: html css asp.net-mvc font-awesome

我正在MVC上构建项目,就像我的大学项目一样。我上传了模板,并进行了布局,其中包括所有CSS和脚本。除了字体外,其他一切看起来都很完美。

<link rel="stylesheet" href="~/Content/frontend/fonts/font-awesome/css/font-awesome.css" type="text/css">
<link rel="stylesheet" href="~/Content/frontend/fonts/elegant_font/HTML_CSS/style.css" type="text/css">
<link rel="stylesheet" href="~/Content/frontend/fonts/et-line-font/style.css" type="text/css">

在CSS里面,我发现这是设置URL的方式,我也应该将它们设置为链接。像这样〜/ contnet。

@font-face {
font-family: 'FontAwesome';
 src: url('/Content/frontend/fonts/font-awesome/fonts/fontawesome-webfont.eot@v=4.1.0');
 src: url('/Content/frontend/fonts/font-awesome/fonts/fontawesome-webfont.eot@#iefix&v=4.1.0') format('embedded-opentype'), url('/Content/frontend/fonts/font-awesome/fonts/fontawesome-webfont.woff@v=4.1.0') format('woff'), url('/Content/frontend/fonts/font-awesome/fonts/fontawesome-webfont.ttf@v=4.1.0') format('truetype'), url('/Content/frontend/fonts/font-awesome/fonts/fontawesome-webfont.svg@v=4.1.0#fontawesomeregular') format('svg');
 font-weight: normal;
 font-style: normal;
}

Here is location where fonts are.

Errors i found with fontawsome are displayed but i have gave proper location where their files are.

0 个答案:

没有答案