我下载了引导3.0,但无法让象形文字工作。我得到一些"E003"错误。知道为什么会这样吗?我在本地和网上都试过了,还是遇到同样的问题。
当前回答
我在硬盘里找这些文件
glyphicons-halflings-regular.woff
glyphicons-halflings-regular.woff2
glyphicons-halflings-regular.eot
glyphicons-halflings-regular.svg
glyphicons-halflings-regular.ttf
然后在。net项目中复制它们的字体文件
其他回答
如果你使用Visual Studio(2015年,在我的情况下)来创建一个ASP。NET Webforms Web Application,带有Bootstrap主题,默认情况下,字形存储在项目根目录下的/fonts文件夹中。
如果您开始将/Content下的引导文件重新安排到子文件夹中(例如,支持多个主题),那么引导中的所有引用都将引导到../fonts/将中断。您可以将字体文件夹移动到/Content下适当的相对路径,或者重命名从../fonts到/fonts。
它看起来像一个UTF字符问题在你的css。只需更新您的引导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.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');}
我使用bootstrap命名空间和象形文字不工作,但在代码中添加上面一行象形文字工作正常。
另一个问题/解决方案可能是使用Bootstrap 2。x代码:
<button class="btn" ng-click="open()"><i class="icon-calendar"></i></button>
当基于指南进行迁移时(。图标-*——> .glyphicon .glyphicon-*):
<button class="btn btn-default" ng-click="open()"><i class="glyphicon-calendar"></i></button>
你忘记添加图标类(包含字体引用):
<button class="btn btn-default" ng-click="open()"><i class="glyphicon glyphicon-calendar"></i></button>
我遇到了这个问题,它是由变量引起的。更少的文件。重写它以设置icon-font-path值解决了这个问题。
文件结构如下所示:
\Content
\Bootstrap
\Fonts
styles.less
variables.less
添加我自己的变量。在Content的根目录中添加less文件,并在样式中引用它。Less解决了404错误。
变量。不包含:
@icon-font-path: "fonts/";