【发布时间】:2016-03-31 20:00:17
【问题描述】:
我正在运行 ASP5/MVC6。
我通过凉亭包括 Bootstrap,像这样:
<link rel="stylesheet" type="text/css" href="~/lib/bootstrap/dist/css/bootstrap.css" />
运行我的应用时,使用 glyphicons 字体的代码 sn-ps 不起作用,例如:
<span class="glyphicon glyphicon-calendar"></span>
它只是显示一个空矩形。
如果我使用 Chrome 调试我的应用程序,我可以看到字体未包含在调试器的“源”选项卡中...那么如何在我的网站中包含这些字体?
编辑:
我的 bootstrap.css 是默认的,所以它有:
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../fonts/glyphicons-halflings-regular.eot');
src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}
我的目录结构与此相符:
【问题讨论】:
标签: css asp.net asp.net-mvc twitter-bootstrap fonts