Log in

View Full Version : One of the validation errorss



remp
05-13-2008, 10:01 PM
Hello. I was trying to validate my website, and sadly :(, very sadly :(, i got LOTS of erros, and one of them is the following:


# Error Line 72, Column 301: end tag for "img" omitted, but OMITTAG NO was specified.

…width="15" height="12" border="0"></a> </p>



You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".


but how am i supposed to close that tag? that was a link and it should be fine... or am i wrong? why can't i validate it because of that kind of errors?

Medyman
05-13-2008, 10:56 PM
I suppose you're using a XHTML DTD.

If you can help it, use HTML 4.01 Strict (or Transitional). XHTML isn't supported in all browsers. And I can say with most probability you're only using HTML. So, in fact, labelling it as XHTML is incorrect and invalid in itself (though it will still validate).

In XHTML, though, all tags need to be closed, as below. Notice the trailing backslash at the end of the tag.


<img src="path/to/image" alt="image" />

thetestingsite
05-13-2008, 10:58 PM
It looks like you are trying to validate as XHTML, in which case you would close your img tag like so:



<img ... />


There are several discussions as to why you should try to avoid using XHTML around the forums.

Hope this helps.

sorry medyman, cross posted