What is the meaning of <img width="1" height="1" alt=""/> ?

Discussion in 'HTML' started by Robert Maas, see http://tinyurl.com/uh3t, Apr 23, 2007.

  1. <img width="1" height="1" alt=""/>
    appears around character position 9202 in the source from Google
    Groups advanced search when there's no such article matching the
    search. Everything looks OK up to the / character. What is that
    doing there?? Why?? In SGML it'd be a NET (is that correct?, which
    would totally screw up the parse here (right?).

    Here's the URL that I used to fetch this bad-looking HTML:
    <http://groups.google.com/groups?as_epq=>
    When I pass it to the W3C validator, it says:
    Result: Failed validation, 224 errors
    although I suspect most of them are because the DOCTYPE declaration
    is totally wrong, claiming the Web page to be XHTML when it's
    nowhere near close to it.

    I tried editing a copy to change the DOCTYPE to
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3c.org/TR/html4/loose.dtd">
    here:
    <http://www.rawbw.com/~rem/NewPub/try-search.html>
    When I pass that to the W3C validator on that, it says:
    Result: Failed validation, 79 errors
    which I suppose is a teeny bit better?

    I tried a couple other publicized doctypes, but neither of these
    helped much either:

    <!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <http://www.rawbw.com/~rem/NewPub/try-search-2.html>
    Result: Failed validation, 198 errors

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
    <http://www.rawbw.com/~rem/NewPub/try-search-3.html>
    Result: Failed validation, 97 errors

    Is there any DOCTYPE/DTD appropriate for this Google Groups page,
    or is it utter trash regardless of the DOCTYPE/DTD?

    Meanwhile I'm going to flush the / character from the original
    WebPage I downloaded so that the HTML parser I wrote a few days ago
    will accept it ... done, and parser likes it now!!
     
    Robert Maas, see http://tinyurl.com/uh3t, Apr 23, 2007
    #1
    1. Advertising

  2. Robert Maas, see http://tinyurl.com/uh3t

    Ben C Guest

    On 2007-04-23, Robert Maas, see http://tinyurl.com/uh3t <> wrote:
    ><img width="1" height="1" alt=""/>
    > appears around character position 9202 in the source from Google
    > Groups advanced search when there's no such article matching the
    > search. Everything looks OK up to the / character. What is that
    > doing there?? Why?? In SGML it'd be a NET (is that correct?, which
    > would totally screw up the parse here (right?).


    I think you may be correct on that. Browsers don't use SGML NET and just
    allow XML-style self-closing elements even in HTML, especially if not in
    strict mode.

    Mr Korpela has explained this a few times, e.g.:

    http://groups.google.co.uk/group/alt.html/msg/8aa884007f82504e?hl=en&
     
    Ben C, Apr 23, 2007
    #2
    1. Advertising

  3. Robert Maas, see http://tinyurl.com/uh3t wrote:

    > Meanwhile I'm going to flush the / character from the original
    > WebPage I downloaded so that the HTML parser I wrote a few days ago
    > will accept it ... done, and parser likes it now!!


    This is precisely the sort of reason I recommended using a prewritten HTML
    parser and not writing your own. There is simply so much broken HTML out
    there -- chances are a third-party parser will do a better job than you
    will unless you have a hell of a lot of patience.

    --
    Toby A Inkster BSc (Hons) ARCS
    http://tobyinkster.co.uk/
    Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

    * = I'm getting there!
     
    Toby A Inkster, Apr 23, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RG90Y29t?=
    Replies:
    4
    Views:
    440
    =?Utf-8?B?RG90Y29t?=
    Nov 9, 2005
  2. Wladimir Borsov
    Replies:
    7
    Views:
    21,627
    eswar
    Apr 20, 2012
  3. Nonee
    Replies:
    7
    Views:
    691
    Nonee
    Oct 28, 2005
  4. MyndPhlyp

    Setting <img> height to match <td> height

    MyndPhlyp, Dec 21, 2003, in forum: Javascript
    Replies:
    5
    Views:
    209
    MyndPhlyp
    Dec 22, 2003
  5. Replies:
    7
    Views:
    207
    Tad McClellan
    Jun 22, 2006
Loading...

Share This Page