从我的桌面加载页面时,IE11 无法识别 HTML5 元素,有什么想法吗?

IE11 not recognizing HTML5 elements when loading a page from my desktop, any ideas why?

我刚开始一份新工作,在午休期间我想练习一些技能,为 MS 70-480 专家考试做准备。我更喜欢用Google Chrome,但是公司有关于安装个人使用软件的规定,所以我一直在使用IE(版本:11.0.9600.18015)。

所以在 notepad++ 中,我为 HTML5 的视频元素创建了简单测试。

<!DOCTYPE html>
<html>
<head>
  <title>70-480 Test Page</title>
</head>

<body>
<header>
  <h1>Practice makes perfect</h1>
</header>
  <section id="sandbox">
    <video width="400" controls="">
      <source src="http://www.w3schools.com/html/mov_bbb.mp4" >
      Your browser does not support the video element.
    </video>
  </section>
</body>
</html>

但是页面没有显示视频。我检查了开发人员工具,发现 DOM Explorer 中原生于 HTML5 的元素(header、视频、部分等)未被识别,而是显示如下:

...
<body>
  <header></header>
    <h1>Practice makes perfect</h1>
  </header><//header>
  <section id="sandbox"></section>
    <video controls="" width="400"></video>
      <source src="http://www/w3schools.com/html/mov_bbb.mp4"></source>
    </video><//video>
  </section><//section>
</body>
....

我知道 IE11 支持这些元素,因为当我在同一浏览器上将我的代码复制到 JSfiddle 时,它​​显示正常。有没有解释为什么 Internet Explorer 让我头疼的问题?

Pedro Mendes 和 Lance Leonard 的评论都有效。

佩德罗的解决方案:

Does your browser have the "Edge (default)" document mode set? Try this tag inside the header

Lance 的解决方案:

Your page is likely being loaded in compatibility view. Please see this previous answer for more info.

我决定采用 Lance 的解决方案,这样如果我以后制作更多页面,我就不必每次都包含元标记。