我在网站上使用Bootstrap 3的图标字体,虽然在大多数浏览器上都能正常显示,但在某些设备上却显示为问号。我找到了这个解决方法:Some of Bootstrap3 glyphicons are not displayed correctly on phonegap android webview,可以解决设备上的问题,但现在在Firefox中,图标字体无法正常工作。(我正在覆盖Bootstrap默认设置,使用CSS中实际的、非转义的字形)。我想知道是否有一种方法,可以使用Firefox的浏览器检测来删除CSS文件中的覆盖,并将其恢复为Bootstrap的CSS。
我找到了这个用于浏览器检测的jQuery插件:https://github.com/gabceb/jquery-browser-plugin 代码: JS
感谢您的帮助。
我找到了这个用于浏览器检测的jQuery插件:https://github.com/gabceb/jquery-browser-plugin 代码: JS
if ( $.browser.mozilla ) {
$('a#calendar span').removeClass('glyphicon-calendar');
$('a#calendar span').css({'glyphicon-calendar:before': 'content: "\1f4c5"'});
}
覆盖Bootstrap的CSS
/* fix glyph not showing on some devices--override the Bootstrap defaults to use the actual, non-escaped glyphs */
.glyphicon-calendar:before {
content: "\d83d\dcc5";
}
Bootstrap 的 CSS
.glyphicon-calendar:before {
content: "\1f4c5";
}
感谢您的帮助。