w3c 对某些点的验证很奇怪
有人可以帮助我并解释为什么这没有经过验证吗?
我的文档类型:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
错误:
1. line 55 column 14 - error: document
type does not allow element "div"
here; missing one of "object",
"applet", "map", "iframe", "button",
"ins", "del" start-tag
<div id="tabs">
2. line 62 column 24 - Fout: document
type does not allow element "div"
here; missing one of "object",
"applet", "map", "iframe", "button",
"ins", "del" start-tag
<div style="clear:both;"></div>
3. line 65 column 22 - Fout: document
type does not allow element "div"
here; missing one of "object",
"applet", "map", "iframe", "button",
"ins", "del" start-tag
4. <div id="calculator">
line 76 column 19 - Fout: document
type does not allow element "div"
here; missing one of "object",
"applet", "map", "iframe", "button",
"ins", "del" start-tag
<div id="feature">
5. line 83 column 7 - Fout: end tag for
"a" omitted, but OMITTAG NO was
specified
</div>
这是 html,也可以在此处查看。
Can someone help me and explain me why this isn't validated?
My doctype:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
The errors:
1. line 55 column 14 - error: document
type does not allow element "div"
here; missing one of "object",
"applet", "map", "iframe", "button",
"ins", "del" start-tag
<div id="tabs">
2. line 62 column 24 - Fout: document
type does not allow element "div"
here; missing one of "object",
"applet", "map", "iframe", "button",
"ins", "del" start-tag
<div style="clear:both;"></div>
3. line 65 column 22 - Fout: document
type does not allow element "div"
here; missing one of "object",
"applet", "map", "iframe", "button",
"ins", "del" start-tag
4. <div id="calculator">
line 76 column 19 - Fout: document
type does not allow element "div"
here; missing one of "object",
"applet", "map", "iframe", "button",
"ins", "del" start-tag
<div id="feature">
5. line 83 column 7 - Fout: end tag for
"a" omitted, but OMITTAG NO was
specified
</div>
This is the html, which can be viewed here also.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不应将块级元素(例如
)放入内联元素(例如
或
)中>
在第 55 行,您有一个未关闭的
元素(超链接)。那么你就只有几个
了。验证器认为这些 div 位于
内。
You shouldn't put a block level element such as
<div>
inside an inline element such as<span>
or<a>
On line 55 you have an
<a>
element (hyperlink) that isn't closed. Then you have few<div>
s. The validator thinks these divs are inside the<a>
.