[whatwg] 'Main Part of the Content' Idiom
Roger Hågensen
rescator at emsai.net
Fri Jun 4 12:58:24 PDT 2010
On 2010-06-04 18:39, Daniel Persson wrote:
> I am not advocating ad-tags. The idea of globally structuring content
> on the web is very appealing, it would make it easier for a lot of
> things and a lot of people. Let's do it!
> ...but I can't see it happening where <body> would be main content +
> ads + anything there is not a sensible tag for + anything a
> lazy/stressed/unconscious author didn't tag otherwise. Let's just have
> a main content tag or a strong main content strategy.
>
Hmm! It is a valid point actually.
Oh and here is some food for though. This works in all latest browsers.
Opera and Firefox have same behavior, while Chrome is a tad different,
and as IE is unable to style unknown tags sadly.
<!doctype html>
<html>
<head>
<title>Test</title>
<style>
aside {border:1px solid #bf0000;white-space:nowrap;}
</style>
</head>
<aside>
Just testing aside outside body!
</aside>
<body>
<article>
Main part of article.
</article>
</body>
</html>
As you can see the aside is outside the body, all latest browsers seem
to handle this pretty fine.
http://validator.w3.org/ on the other hand gives the error " /Line 12,
Column 6/: body start tag found but the body element is already open.|
<body*>*|"
Now, either that is a bug in the validator, or the body is automatic.
And sure enough, removing the <body> and </body> tags the document
validates, and none of the browsers behave differently at all.
Is the body tag optional or could even be redundant in HTML5 ?
I don't mind really, as currently I only use body to put all the "other"
tags inside, so not having to use the body tag at all would be welcome,
though I suspect a lot of legacy things rely on the body tag.
--
Roger "Rescator" Hågensen.
Freelancer - http://EmSai.net/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20100604/f606381e/attachment-0002.htm>
More information about the whatwg
mailing list