I read in tutorials that img
tags don't have ending tag. But, while inspecting html of various pages I noticed that some img
tags have ending tag </img>
or <img ... />
and some don't have ending tag and appear just <img ... >
. In what cases they don't have an ending tag?
</img>
) but provides alternative syntax with a /
at the end of the start tag (instead of an end tag) for elements which have no content.<img>
elements but (for backwards compatibility with XHTML) permits a meaningless /
to appear at the end of a start tag on elements where the end tag is forbidden.