【问题标题】:Html5 elements not working in ie8?Html5 元素在 ie8 中不起作用?
【发布时间】:2014-04-16 21:15:47
【问题描述】:

我试图让我在 html5 中做的网页在 ie8 中工作,但它看起来到处都是。

它在 ie9+、chrome 和 firefox 中完美运行。

我尝试在css之前的head部分添加html5.js,但还是不行

<!--[if lt IE 9]>
        <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

网页在这里供您测试:

https://vvpx.localtunnel.me

【问题讨论】:

  • 在你的 css 加载后尝试粘贴它,但仍然在头部。
  • @cab 我试过了,但还是不行,谢谢
  • 放回原处看看我的回答

标签: html internet-explorer-8 cross-browser


【解决方案1】:
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

你在 https: 并且 shim/shiv 是 http: 所以删除 http:

【讨论】:

  • 发帖人说可以在其他浏览器上运行,但是IE8不行……怎么可能在其他浏览器上运行??
  • 因为其他浏览器都不需要,所以在条件句之间
【解决方案2】:

使用此链接检查 IE8 是否支持您希望实现的 HTML5 元素:HTML5 Support

IE8 陈旧且有缺陷,而且它肯定不支持大多数 HTML5 元素(在比较列表中将 IE9 替换为 IE8)。

【讨论】:

    【解决方案3】:
    <!--[if lt IE 9]>
       <script>
          document.createElement('header');
          document.createElement('nav');
          document.createElement('section');
          document.createElement('article');
          document.createElement('aside');
          document.createElement('footer');
       </script>
    <![endif]-->
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-07-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多