HTML5 验证错误
基本上我正在将一些我制作的模板转换为 html 5。
做了一些研究并尝试创建一个名为“wrapper”的新元素。
跨浏览器等一切正常,但在验证时我收到了此消息:
第 16 行,第 13 列:在此上下文中不允许元素包装器作为元素主体的子元素。 (抑制此子树中的更多错误。)
这是代码缩小版本的链接。
http://eosa.co.cc/themes2/html5/sof.html
查看源码。
不确定这意味着什么或为什么它不会验证,有人有什么想法吗?
Basically I'm converting some template I made into html 5.
Done a little research and tried to create a new element called 'wrapper'.
All works fine cross browser etc, but when it came to validating i got this message:
Line 16, Column 13: Element wrapper not allowed as child of element body in this context. (Suppressing further errors from this subtree.)
Here's a link to a minified version of the code.
http://eosa.co.cc/themes2/html5/sof.html
View the source.
Not sure as to what this means or why it won't validate, any one have any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
没有
wrapper
元素,但您可以使用div
甚至 主体作为包装器。There is no
wrapper
element, but you can usediv
or even body as a wrapper.没有诸如“wrapper”之类的 html 5 标签,但有“section”等。请查看此网站以获得更清晰的解释:
There's no html 5 tag such as "wrapper", but there are "section" etc. Check out this website for a more clean explanation: http://jackosborne.co.uk/articles/html5-wrapper/
正如所指出的,不存在“包装器”元素,
您可能会想到包装器 div,它用于为您的页面预定义包装器上下文。
你想要做的是这样的:
只是注意,这与 html5 无关,它在所有 HTML 版本中都可用
包装器主要用于设计目的,在构建网页时不是强制性的,但我建议你使用一个这样您就可以为您的客户设置最佳宽度,并在正文中专门对齐您的内容!
As pointed out there is no element "wrapper"
what you more than likley thinking of is a wrapper div, witch is used to predefine a wrapper context for you page.
What you want to do is like so:
Just a note, This has nothing to do with html5, its available in all HTML versions
Wrappers are mainly used for design purposes and is not compulsory when building web pages, but I would advise you use one so that you can set the best width for your client, and also specifically align your content within the body!