W3C home > Mailing lists > Public > www-validator@w3.org > March 2007

Re: img element has no attribute "src", "alt", "width", "border"

From: Drake Wilson <drake@begriffli.ch>
Date: Sun, 11 Mar 2007 23:08:33 -0500
To: Konrad Aderer <konrad@lifeorliberty.org>
Cc: www-validator@w3.org
Message-ID: <20070312040833.GA6637@drache.begriffli.ch>
Quoth Konrad Aderer <konrad@lifeorliberty.org>, on 2007-03-10 01:40:11 -0500:
> That's what a bunch of error messages I when I validated the page below. As
> I understand, that means it's not correct to use those attributes in an
> image tag. It seems there must be something else wrong, since those are used
> everywhere.

You're using an XHTML doctype, and XHTML is an XML type.  That means
that tag names are case-sensitive, so "IMG" is not valid; you must use
the lowercase "img" instead.

Moreover, in XHTML, all tags must be closed; you cannot have

  <img src="foo">

but must instead use the proper XML empty-tag form

  <img src="foo" />

(with the space before the slash being recommended for compatibility
with browsers that will attempt to render as tag soup).  Similarly for
"br" and other tags that are not normally closed in HTML 4.

> Thanks,
> 
> Konrad

   ---> Drake Wilson

Received on Monday, 12 March 2007 04:08:47 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:23 GMT