![Why Are My Bootstrap 3 Glyphicons Showing 'E001' in Firefox?](https://img.php.cn/upload/article/000/000/000/173115864661189.jpg)
Firefox 中的 Bootstrap 3 Glyphicon 显示问题
从 Bootstrap 2.3 迁移到 Bootstrap 3 后,用户可能会遇到 glyphicon 图标无法显示的问题正确地显示为“E001”而不是预期的图标。这个问题尤其在 Firefox 中遇到,而其他浏览器可以准确地渲染图标。
解决方案
此行为最可能的解释在于使用了自定义版本的引导程序。在此版本中,包中包含的字体文件已损坏(如 https://github.com/twbs/bootstrap/issues/9925 中所示)。要解决此问题,请按照以下步骤操作:
- 避免使用 CDN 并手动下载以下字体文件:
- https://netdna.bootstrapcdn.com/bootstrap/3.0.0/fonts/glyphicons-halflings-regular .svg
- https://netdna.bootstrapcdn.com/bootstrap/3.0.0/fonts/glyphicons-halflings-regular.woff
- https://netdna.bootstrapcdn.com/bootstrap/3.0.0/fonts/glyphicons-halflings-regular.ttf
- https ://netdna.bootstrapcdn.com/bootstrap/3.0.0/fonts/glyphicons-halflings-regular.eot
- 替换现有字体文件与下载的字体文件。
- 在 Firefox 中按 CTRL F5 执行强力重新加载,强制浏览器加载更新的文件。
此过程应该可以解决问题在 Firefox 中显示字形。
以上是为什么我的 Bootstrap 3 Glyphicons 在 Firefox 中显示'E001”?的详细内容。更多信息请关注PHP中文网其他相关文章!