|
Posted by Benjamin Niemann on 06/02/07 16:33
Hello,
Knut Krueger wrote:
> why is the code reported as valid?
> IE and Opera will display nothing without the > after the link
>
> Regards Knut
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "http://www.w3.org/TR/html4/strict.dtd">
> <html>
> <head>
> <meta content="text/html; charset=windows-1252" http-equiv="content-type"
> >
>
> <title>image problem</title>
> </head>
> <body>
> <div>
> <A HREF="http://www.w3.org" <img
> src="http://www.w3.org/Icons/WWW/w3c_home_nb" alt="wc3"/> </A>
> </div>
>
> </body>
> </html>
The '<A ... ' followed by '<img ...' is a so-called 'unclosed start-tag'
[1], which is valid SGML syntax, but not supported by 'tag-soup' parsers
found in browsers.
There's also a XMLish '<img .. />' tag in there, which is valid in this
context, but - when parser by the SGML rules - not what you want, though
tag-soup parsers treat it the way you want it. '<img .. />' equals '<img ..
>>' where the second '>' is parsed as character data. Tag-soup parsers
probably treat the '/' as a syntax error which is silently ignored.
Reporting such things is beyond the scope of a markup validator, though it
may be of great help for web authors.
HTH
[1]: If the start-tag is immediately followed by a TAGO '<' or STAGO '</',
you may omit the TAGC '>'.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
Navigation:
[Reply to this message]
|