【问题标题】:glyphicon icons not appearing in my MVC site having bootstrap implemented我的 MVC 站点中没有出现 glyphicon 图标并已实施引导程序
【发布时间】:2014-10-02 09:24:35
【问题描述】:

以下是我的 HTML 标记

<button class="btn btn-default" type="submit">
<i class="glyphicon glyphicon-camera"></i>
</button>

我已经更改了以下行 variable.less

@icon-font-path:          "..\fonts";

字体文件夹包含四个文件 - 用于 glyphicons-halflins 的 eot、svg、ttf 和 woff 扩展文件

以下是文件夹结构 -

  • 内容\bootstrap.css
  • 内容\bootswatch.css
  • Content\variables.less
  • Contact\fonts -- 所有四个文件(扩展名 - eot、svg、ttf 和 哇)

知道为什么它不在网页中显示图标吗?

非常感谢任何帮助。

【问题讨论】:

  • 1) 这是在开发中还是已经部署? 2) 您为@icon-font-path 发布的内容是目前的内容,还是您更改之前的内容?你的措辞不清楚。
  • 1) 这是在开发本身中.. 2) 当我从 bootply 下载 variables.less 文件时,@icon-font-path 是相同的...

标签: asp.net-mvc twitter-bootstrap asp.net-mvc-4 glyphicons


【解决方案1】:

那么,你的路径是错误的。 variables.less/Content 中,而您的字体文件在/Content/fonts 中,但是您的路径是从/Content 上升一级,使其只是/,然后在那里查找fonts 目录,即/fonts,不是/Content/fonts。删除字体路径的../ 部分,然后重试。

【讨论】:

    【解决方案2】:

    您使用反斜杠指定路径。您是否尝试过使用正斜杠? 看看Is there a way to set a common image path for LESS files?。他们都使用了正斜杠。

    【讨论】:

    • 哦,好的。我认为这就是问题所在。但是看看克里斯普拉特的回答。我想他真的明白了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-04-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-18
    • 1970-01-01
    • 2014-01-01
    相关资源
    最近更新 更多