开发者

HTML5 Validation Error

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?


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


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/


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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜