Re: It validates az HTML5 with no </head> and no </body>.

2011-12-11 5:24, Jay Litwyn wrote:

> http://ecn.ab.ca/~brewhaha/Moss_Filter.HTM

Please do not post attachments to the list. Instead, include a working 
URL, or working URLs. The URL above does not work (404 Not Found). You 
may have meant
http://ecn.ab.ca/~brewhaha/Biology/Moss_Filter.HTM

> I actually had to remove the </head> and </body>  tags to make it
> validate.

Which "it"? The attachment contains </body> but not </head>; it passes 
the "validation" (W3C Markup Validation service in HTML5 mode, which is 
heuristic checking against a mutable draft), and continues to do so if 
the </head> tag is added, provided of course that it is correctly placed.

The document at the URL I mentioned also contains </body> but not 
</head>. It does not pass "validation", but this does not depend on end 
tags. It depends on misplaced <embed> tag. It may only appear within 
document body, so it implicitly opens the body element in this case, and 
the <body> tag would then create a body within a body, which is 
prohibited. Moreover, the style element is misplaced: it may not appear 
inside the body, except under certain odd conditions by HTML5 rules.

So just move the <embed> tag after the style element (i.e. after the 
</style> tag) and either remove the <body> tag or place it properly (in 
this case, before the <embed> element).

The attachment (and the online document if fixed as suggested here) 
passes "validation" only due to serious limitations in "validation". In 
particular, you are using an <img> tag without an alt attribute. This 
would not pass in validation with an HTML 4.01 doctype, but in HTML5, 
omission of the alt attribute is allowed under special conditions, which 
are of such nature that automated checking will not be possible for a 
few decades (it would require highly sophisticated artificial 
intelligence). For some odd reason, no warning is given either, even 
though omission of the alt attribute is wrong in more than 99.99% of cases.

> The attachment, however, *should
> cease* to validate.

What makes you think so? It sounds like you though that </head> and 
</body> tags were obligatory. They surely aren't in HTML5 when 
serialized as HTML. They are obligatory only in XHTML.

Yucca

Received on Sunday, 11 December 2011 09:51:42 UTC