问题描述
你好我正在验证我对html 5的来源。
Hello I am validating my source against html 5.
但我收到这个错误,现在知道如何解决它:
But I am getting this error and have now idea how to solve it:
<meta charset="utf-8"><title>Rode kruis Vrijwilligers applicatie</title><link href="/css/blitzer/jquery-ui-1.8.11.custom.css" media="screen" rel="stylesheet" type="text/css" >
这是错误:
XHTML在此上下文中,元素标题不允许作为XHTML元素元的子元素。 (抑制此子树中的更多错误。)
XHTML element title not allowed as child of XHTML element meta in this context. (Suppressing further errors from this subtree.)
任何想法?
推荐答案
< area />,< base />,< basefont / >,< br />,< hr />,< input />,< img />,< link />,< meta /> 只对属性有用,所以你必须用/>而不是>来关闭它们。
在XML中你如何在同一个标签中打开和关闭标签,这就是你的html应该是这样的:
In XHTML which is strict about XML rules, every tag that is opened should be nested and closed properly, tags such as <area />,<base />,<basefont />,<br />,<hr />,<input />,<img />,<link />,<meta />
are only usefull with attributes so you have to close them by "/>" instead of ">"In XML thats how you open and close a tag in the same tag, this is what your html should look like:
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Rode kruis Vrijwilligers applicatie</title>
<link href="/css/blitzer/jquery-ui-1.8.11.custom.css" media="screen" rel="stylesheet" type="text/css" >
</head>
<body>
Test.
</body>
</html>
这篇关于带有标题标记的Html5验证错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!