Svg仅在Internet Explorer中更改了我的网页布局

时间:2017-09-28 12:27:53

标签: javascript jquery css google-chrome internet-explorer

我建立了一个漂亮的网站,有很多svg的。该页面响应非常快,因为关闭了引导程序。可能是我建立过的最好的网站之一。但是,当我在Internet Explorer 11中测试我的网站时,svg会弄乱我的布局。我在Internet Explorer上尝试使用javascript加载新的css文件。在IE中,代码显示在url中,在其他浏览器中显示为false。但是我的css文件总是被替换为styleie.css(Internet Explorer样式表)并且不会在chrome中显示我的普通样式表。您有什么推荐的吗?提前致谢。特别适用于IE-11。

window.location.hash = !!window.MSInputMethodContext;
  if (window.location.hash) 
      {   var $head = $("head");
          var $headlinklast = $head.find("link[rel='stylesheet']:last");
          var linkElement = "<link rel='stylesheet' href='/styleie.css' type='text/css' media='screen'>";
          if ($headlinklast.length){
             $headlinklast.after(linkElement);
          }
          else {
             $head.append(linkElement);
          }
   }

0 个答案:

没有答案