Stray end tag img


If your document is XHTML compliant then you have to close img tag with <img src="image.jpg"/>, not with <img>...</img>.

If your document is HTML5 compliant, then you do not need the /> part, only use <img src="image.jpg">

And if you wonder what means that document should be XHTML or HTML5 compliant - this is the very first line of your HTML page, the so called document type definition:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> for XHTML 1.0 Transitional

NOTE: The <!DOCTYPE> declaration is mandatory (if you want your pages to validate with an HTML validator) and should always be the first thing in an HTML document.

NOTE: Although a document type definition is technically not required for a functioning web page, it is good practice to always include it in your code. As you learn to build web pages, get into the habit of always including the document type definition in your code.

Related Post

Latest Post

Recent Posts Widget

Make sure to never miss a thing...

Get the latest news from the creative industry along with other creative goodies, conveniently delivered to social media.