Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- New requirement for img tags? ( like )
June 11, 2006, 11:43 pm
rate this thread
I have switched to a new HTML editor that comes with the Eclipse IDE
This editor flags image tags such as
<img src="http://xyz.com/images/logo.gif" alt="test" >
saying that the "element type "img" must be terminated by a matching
If I change the above img tag to
<img src="http://xyz.com/images/logo.gif" alt="test" />
i.e., I close the tag with a forward slash and angle right bracket,
than there are no more complaints.
Is this a new rule in HTML, that tags need to be treated more like
common XML and closed "properly" with "/>".
Thanks for your help and advice,
Santa Barbara, CA
Re: New requirement for img tags? ( like )
That's not a doctype (search this ng - we beat this issue to death
regularly) but it does strongly suggest you're trying to write XHTML,
rather than HTML.
If you're writing XHTML, then yes, <img /> now needs to be closed
because you're working with XML, not SGML or HTML.. You should know
this. If you don't know this, and you don't desperately _need_ this,
then don't write XHTML, stick with HTML (which is no more XML now than
it has ever been).
XHTML may have its uses (opinions vary), but it certainly shouldn't be
used blindly. There are lots of problems with its correct, practical
- » Show image top left in html page, how can I do that ?
- — Previous thread in » HTML Authoring Forum