November 4, 200916 yr I am getting an error on html validation on my images because of the /> part at the end, like in this snippet taken from w3schools: <img src="angry.gif" alt="Angry face" /> The error message is: NET-enabling start-tag requires SHORTTAG YES The explantion: The sequence <FOO /> can be interpreted in at least two different ways, depending on the DOCTYPE of the document. For HTML 4.01 Strict, the '/' terminates the tag <FOO (with an implied '>'). However, since many browsers don't interpret it this way, even in the presence of an HTML 4.01 Strict DOCTYPE, it is best to avoid it completely in pure HTML documents and reserve its use solely for those written in XHTML. Any ideas how to fix this?
November 4, 200916 yr What doc type are you using, if its not xhtml then close the img tag with just > Pat
November 4, 200916 yr change your doctype to xhtml e.g. xhtml strict <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> I'm guessing your doctype is html 4 based, which doesn't accept short tags, you need to remove the / from the end of the code
Create an account or sign in to comment