css - 为什么 Bootstrap Glyphicons 仅在 Google Chrome 中调试时出现?

标签 css google-chrome asp.net-mvc-4 twitter-bootstrap glyphicons

我使用的是 Twitter Bootstrap 2.3.2,当我在 MVC4 中开发应用程序时,我对 Glyphicons 没有任何问题,直到我在 Firefox 和 IE 中对其进行了测试。

在 firefox 中,我得到以下图像而不是图标: Error

我检查了对 glyphicons 图像文件的引用,它们都是正确的。

在 Chrome 中调试时,我可以完美地看到图标(我清除了缓存以查看是否是这个问题,但图标仍然存在)。

最佳答案

你应该检查你的 glyphicons 相对 url 的格式是否正确:

如果你的字形图像文件在../icon/glyphicons.png

url('../icon/glyphicons.png')

但要小心,如果文件实际上在 ../img/icon/glyphicons.png 中,则 url 应该是:

url('../img/icon/glyphicons.png')

关于css - 为什么 Bootstrap Glyphicons 仅在 Google Chrome 中调试时出现?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20021404/

相关文章:

asp.net - 每当重新加载应用程序域时,您如何强制 IIS 应用程序池重新启动?

mysql - MembershipUser.ChangePassword 方法始终返回 false

jquery - 在滚动时更改背景位置 x

google-chrome - 仅过滤有错误的请求 - Google chrome 网络

javascript - 页面加载时的 jquery 淡入适用于除 IE 之外的所有浏览器

javascript - 开发 Chrome 扩展时,如何打开空白页面来运行脚本?

google-chrome - Chrome 拒绝清除 Javascript 缓存(即使在硬重新加载和手动清除缓存之后)

asp.net-mvc-4 - @using(Html.BeginForm()) 返回格式异常 mvc4

css - WordPress/CSS : Force a class that inherit from another

javascript - HTML/CSS/JavaScript : Force child elements to never exceed parent size without modifying children