带有HTML5内容的HTML 4 iframe [英] HTML 4 Iframe with HTML5 content

查看:125
本文介绍了带有HTML5内容的HTML 4 iframe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有另一个问题。
我创建了一个包含 xhtml1 doctype 的页面。

So i have another question. I made a page with a xhtml1 doctype.

<!DOCTYPE html PUBLIC - / / W3C // DTD XHTML 1.0 Strict // ENhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>

我在该页面上放置了一个视频元素,以及一个使用占位符的表单元素。我认为视频和占位符无法加载/被识别,因为我不使用HTML5文档类型。

And i put on that page a video element, and a form element thats using a placeholder. It would make sense to me that the video and placeholder wouldnt load/be recognized because i dont use a HTML5 doctype.

然而,情况正好相反,加载为html5。

要添加,我在xhtml1页面中创建了一个iframe。我想知道,如果我将一个HTML5页面作为iframe中的一个来源会发生什么。最后,它也加载为html5。

To add to that, i created an iframe in the xhtml1 page. I was wondering, what would happen if i would put an HTML5 page as a source inside that iframe. Concluding, it also loads as html5.

但是,我如何确保xhtml1页面不加载html5,而iframe html5页面呢?

However, how can i make sure that the xhtml1 page doesnt load html5, and the iframe html5 page does?

我认为差异是doctype ,但也许其他?浏览器?或者在某个地方有一个转发点,使浏览器将其初始化为xhtml1,使用html5加载iframe,并将整个页面作为html5返回?

I assumed the difference was the doctype, but maybe its something else? Browser? Or is there a repost somewhere making the browser initialize it as xhtml1, loading the iframe with html5, and returning the entire page as html5?

是否有人有信息对这个?可能有办法解决它?

感谢您的帮助! :))

Thank you for your help! :)

Ps:
1x xhtml1 iframe页面。 (应该只加载xhtml1)
1x html5页面放置在iframe中。 (应加载html5)
如果一切都太混乱,我会发布小代码来说明问题。就告诉我嘛。

Ps: 1x xhtml1 page with iframe. (should only load xhtml1) 1x html5 page placed in the iframe. (should load html5) If everything is too confusing, i will post small code sampled to illustrate the problem. Just tell me.

推荐答案

您在标题中放置的内容类型与解析标记的浏览器无关。
所以如果你的html代码有html5标签,它们将正常执行。

除了手动检查代码外,我没有办法阻止这种情况。

the type of content you put in header has nothing to do with the browser parsing the tags. so if your html code has html5 tags, they will be executed as normal.
i don't see any way to stop this except by manually checking with code.

这篇关于带有HTML5内容的HTML 4 iframe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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