为什么不会< iframe>元素在HTML 4.01中验证? [英] Why won't <iframe> elements validate in HTML 4.01?
问题描述
我只是检查一下< noscript> $ c中是否有
元素是有效的$ c>元素作为显示动态内容的后退。它使用HTML 5 doctype进行了验证,但对于HTML 4.01,我得到以下错误:
第9行,第35列:元素IFRAME未定义
您已在文档中使用上述名称的元素,但您使用的文档类型未定义该名称的元素。此错误通常是由以下原因引起的:
- 不正确地使用Strict文档类型和使用框架的文档(例如,您必须使用Frameset文档类型以获取元素),使用供应商专有的扩展名(例如或)来获取
- (这通常是通过使用CSS来获得所需效果)。通过在XHTML中使用大写标签(在XHTML属性和元素中必须全部为小写),可以使用
- 。
这是我将HTML缩减为:
<!DOCTYPE html PUBLIC - // W3C // DTD HTML 4.01 // EN
http://www.w3.org/ TR / HTML4 / strict.dtd>
< html>
< head>
< title>我是您的文档标题REPLACE ME< / title>
< meta http-equiv =Content-Typecontent =text / html; charset = UTF-8>
< / head>
< body>
< div>
< iframe name =testsrc =test.htm>< / iframe>
< / div>
< / body>
< / html>
定义< iframe>
元素在以下URL的HTML 4.01规范中: http:// www .w3.org / TR / html401 / present / frames.html#h-16.5 。
它通过一个过渡型文档,所以我猜我的问题是为什么在严格的文档类型中不允许使用,即使它是在规范中定义的?。
为什么它在严格的文档类型中是不允许的,即使它是在规范中定义的? 很多东西都是在在严格的 我可以想到两个原因wh他们可能会认为: I was just checking to see if it was valid to put an Line 9, Column 35: element "IFRAME" undefined You have used the element named above in your document, but the document type you are using does not define an element of that name. This error is often caused by: This is what I whittled the HTML down to: The It passes with a transitional doctype, so I guess my question is "Why is it disallowed in a strict doctype, even though it's defined in the specification?". "Why is it disallowed in a strict doctype, even though it's defined in the specification? Lots of things are defined in the specification but not allowed in Strict. I can think of two reasons why they might have thought that: 这篇关于为什么不会< iframe>元素在HTML 4.01中验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
< font>
规范中是不允许的,这些是规范开发人员需要记录的东西,它们在浏览器中使用在这一天,但应该从过渡。
< iframe>
(理论上)很少用< object> ;
<iframe>
element inside a <noscript>
element as a fall back for displaying dynamic content. It validated fine with the HTML 5 doctype, but for HTML 4.01, I get the following error:
<iframe name="test" src="test.htm"></iframe>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>I AM YOUR DOCUMENT TITLE REPLACE ME</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div>
<iframe name="test" src="test.htm"></iframe>
</div>
</body>
</html>
<iframe>
element is defined in the HTML 4.01 specification at the following URL: http://www.w3.org/TR/html401/present/frames.html#h-16.5.
<font>
springs to mind. These are the things that the developers of the specification considered in need of documenting, were in use in browsers in the day, but which should be transitioned away from.
<iframe>
does (in theory) little that can't be achieved with <object>