Re: [VE][247] Add Subject Here

2011-11-16 18:16, Leif Halvard Silli wrote:

>>> Warning Line 61, Column 68: NET-enabling start-tag requires SHORTTAG YES
>>>
>>> <img src="pic1.jpg" width="200" height="200" alt="alathitunguang1" />
>>
>> In other words, don't use "/>" to close<img>  tags in HTML 4.01
>> Transitional.
>
> My reading of the facts, puts the blame on the validator: It would not
> matter very much if the HTML4 validator had stopped issuing that
> warning. Especially now that HTML5 allows the use of "/>" to close
> <img>  tags. But even per HTML4's rules,  it is only a warning and not
> an error.

Per the rules of HTML 4.01, the construct is equivalent to
<img src="pic1.jpg" width="200" height="200" alt="alathitunguang1">>
which means that there is an extra ">" as data. Though this does not 
make the document invalid,

<base href=foo />

would do that, as the extra ">" would be inside the <head> element, 
where character data is not allowed. Similarly, with HTML 4.01 Strict,

<body><hr />

would be a syntax error, as it would mean

<body><hr>>

and in Strict, character data is not allowed as content directly inside 
<body>.

It can be argued, as many people do, that no browser actually implements 
HTML 4.01 in this respect. But software advertised to perform markup 
validation should do exact validation, without dropping some rules, 
especially if its reports specifically refer to HTML 4.01, in a rather 
formal tone at that.

Yucca

Received on Wednesday, 16 November 2011 16:32:55 UTC