【发布时间】:2015-06-24 01:13:54
【问题描述】:
我正在使用 Bootstrap v3.3.x 及其字形图标。出于某种原因,在远程服务器上,而不是在本地,找不到带有字体的文件夹,因此没有加载字形图标。在 chrome 调试器中它说:
x GET http://the IP/web 应用文件夹/Content/fonts/glyphicons-halflings-regular.woff .................... ..................... /web 应用程序文件夹/Content/fonts/glyphicons-halflings-regular.woff:1
由于找不到文件而指示错误。
我检查了以下内容:
包括 bootstrap 和 bootstrap-theme 样式表
文件夹
fonts与文件夹css处于同一级别:~/Content/css/bootstrap.min.css、~/Content/css/bootstrap-theme.min.css和~/Content/fonts/我已将必需的
mimeMap条目添加到web.config
<staticContent>
<remove fileExtension=".eot" />
<remove fileExtension=".ttf" />
<remove fileExtension=".otf" />
<remove fileExtension=".woff" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".ttf" mimeType="application/octet-stream" />
<mimeMap fileExtension=".otf" mimeType="image/svg+xml" />
<mimeMap fileExtension=".woff" mimeType="application/x-woff" />
</staticContent>
如果我从远程位置加载整个引导库,我还检查了一切是否正常:
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
问题是我下载了带有自定义组件的库,并且必须引用服务器上的库。
干杯
【问题讨论】:
标签: asp.net-mvc twitter-bootstrap