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

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 UTC