Re: Element h10, validating HTML5

2012-09-27 21:02, G. Vlokkentest wrote:

>      Error Line 61, Column 49: Element script must not have attribute
> charset unless attribute src is also specified.
>
>              <script type="text/javascript" charset="utf-8">

The HTML5 draft clearly specifies such a restriction. The rationale is 
that the charset parameter is for specifying the encoding of an external 
script file and would not make sense (and would be misleading to a 
person reading HTML code) when the script is not external (specified via 
a src attribute) but embedded in the HTML document (in the content of 
the <script> element). An embedded script is always treated using the 
same encoding as the HTML document in general.

So the attribute should be omitted, and you should check that the 
embedded script code is in fact in the same encoding as the HTML 
document in general.

>      Error Line 277, Column 121: Element h10 not allowed as child of
> element a in this context.

The error message is misleading. Element h10 is not allowed at all. 
HTML5 drafts follow the classic HTML model where heading elements are h1 
through h6 only.

Technically, HTML5 allows headings of the 10th level, though. If you 
nest <section> elements down to the 10th level, then an <h1> element 
inside the innermost <section> is treated as a 10th level heading, even 
though the element name suggests otherwise. This is however pure theory 
so far, as much of HTML5 is.

>      …lass="textwidget"><a href="/over-ons"><h10>Over Ons</h10></a><br />

As a completely different issue, HTML5 lets you nest a heading element 
inside an <a> element. For example, <a href="/over-ons"><h2>Over 
Ons</h2></a> is allowed. All existing HTML specifications disallow that, 
even though browsers allow it. There’s a functional difference: if you 
have elements nested that way, then, by default, clicking on somewhere 
on the right of the words “Over Ons” means following the link. This is 
because the <h2> element is a block element that occupies the available 
width 100% by default. If you nest the other way around, <h2><a 
href="/over-ons">Over Ons</a></h2> (which is valid in all versions of 
HTML), then only the text content “Over Ons” is an active area for clicking.

I wonder what could possibly make anyone want to make a link like “Over 
Ons” (About us) a 10th level heading (which is what <h10> would mean if 
it were allowed).

Yucca

Received on Friday, 28 September 2012 16:37:58 UTC