【问题标题】:Bootstrap icons not displaying on initial load in Internet Explorer 8在 Internet Explorer 8 中初始加载时不显示引导图标
【发布时间】:2014-06-24 11:00:20
【问题描述】:

我有一个网站,我在业余时间做。我用它来展示南非的山地自行车赛事。它是在ASP.NET MVC 5 和最新版本的Bootstrap 3 中完成的。

我正在为 Internet Explorer 8 提供服务,并且 Google Analytics 正在显示此浏览器的一些活动。我有Respond JS 以及html5 shiv。

在顶部菜单中,您会看到主菜单选项。在它旁边我有一个房子的图标。当网站在 Internet Explorer 8 中首次加载时,您会看到它没有显示,它只是显示一个白色块。当我将鼠标悬停在它上面或单击主页时,它会显示。为什么是这样?它在 Firefox 和 Google Chrome 中运行良好。

该网站位于 Arvixe 的共享主机上。我注意到,当我通过带有应用程序池的 Internet 信息服务 (IIS) 运行网站时,图标会正常加载。当我删除应用程序池时,它无法正常加载。

【问题讨论】:

    标签: jquery css twitter-bootstrap internet-explorer asp.net-mvc-5


    【解决方案1】:

    这是 IE 中与 :before 和 :after 伪元素相关的错误。

    请参阅this question 了解更多信息,我只想说,有一个 JS 解决方法。您可能需要根据自己的具体情况对其进行调整。

    var head = document.getElementsByTagName('head')[0],
        style = document.createElement('style');
    style.type = 'text/css';
    style.styleSheet.cssText = ':before,:after{content:none !important';
    head.appendChild(style);
    setTimeout(function(){
        head.removeChild(style);
    }, 0);
    

    【讨论】:

      猜你喜欢
      • 2012-11-16
      • 2014-06-16
      • 1970-01-01
      • 2015-12-07
      • 2014-10-06
      • 1970-01-01
      • 1970-01-01
      • 2011-08-31
      • 2013-03-20
      相关资源
      最近更新 更多