HTML5 验证错误

发布于 2024-09-27 00:58:28 字数 404 浏览 1 评论 0原文

基本上我正在将一些我制作的模板转换为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

守望孤独 2024-10-04 00:58:28

没有 wrapper 元素,但您可以使用 div 甚至 主体作为包装器

There is no wrapper element, but you can use div or even body as a wrapper.

旧伤慢歌 2024-10-04 00:58:28

没有诸如“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/

睫毛溺水了 2024-10-04 00:58:28

正如所指出的,不存在“包装器”元素,

您可能会想到包装器 div,它用于为您的页面预定义包装器上下文。

你想要做的是这样的:

<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title></title>
        <style>#wrapper { width:100%; height:100%; display:block }</style>
    </head>
    <body>
        <siv id="wrapper">

       </wrapper>
    </body>
</html>

只是注意,这与 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:

<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title></title>
        <style>#wrapper { width:100%; height:100%; display:block }</style>
    </head>
    <body>
        <siv id="wrapper">

       </wrapper>
    </body>
</html>

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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文