从我的桌面加载页面时,IE11无法识别HTML5元素,为什么有想法? [英] IE11 not recognizing HTML5 elements when loading a page from my desktop, any ideas why?

查看:229
本文介绍了从我的桌面加载页面时,IE11无法识别HTML5元素,为什么有想法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始一份新工作,在午休时,我想练习一些技能,为MS 70-480专业考试做准备.我更喜欢使用Google Chrome浏览器,但该公司对安装供个人使用的软件有规定,因此我只能使用IE(版本:11.0.9600.18015).

I just started a new job and during my lunch brake I wanted to work on practicing some skills to prep for the MS 70-480 specialist exam. I prefer using Google Chrome, but the company has rules about installing software for personal use so I am stuck working on IE (version:11.0.9600.18015).

因此,在notepad ++中,我为HTML5的视频元素创建了简单测试.

So in notepad++ I created the simple test for HTML5's video element.

<!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>

但是页面返回了而没有视频显示.我检查了开发人员工具,发现在HTML5固有的DOM Explorer元素(标题,视频,部分等)中,这些元素未被识别,而是显示如下:

But the page came back without the video showing. I checked the Developer tools and found in the DOM Explorer elements native to the HTML5 (header, video, section, etc.) are not being recognized and instead are showing such as:

...
<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会给我带来这种头痛?

I know IE11 supports the elements since when I copy my code to JSfiddle on that same browser it shows up fine. Is there an explanation for why Internet explorer is giving me this head ache?

推荐答案

佩德罗·门德斯(Pedro Mendes)和兰斯·伦纳德(Lance Leonard)的评论均奏效.

Both Pedro Mendes and Lance Leonard's comments worked.

佩德罗的解决方案:

您的浏览器是否设置了"Edge(默认)"文档模式?尝试 标题中的

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

兰斯的解决方案:

您的页面可能已在兼容性视图中加载.请参阅 有关更多信息,请参见上一个答案

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

我决定采用Lance的解决方案,以便将来以后制作更多页面时,不必每次都包含meta标签.

I decided to go with Lance's solution so that if I make more pages in the future I won't have to include the meta tag every time.

这篇关于从我的桌面加载页面时,IE11无法识别HTML5元素,为什么有想法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆