Common HTML Elements, Images: Is a Forward Slash Really a Requirement?


#1

Common HTML Elements, Images: Is a Forward Slash Really Requirement?

The text on the exercise Common HTML Elements: Images says:

…Also note that the end of the < img > element has a forward slash /. This is required for a self-closing element.

But is that really so?

On similar exercises on Khan Academy and Free Code Camp, this is never mentioned and the code seems to work fine without it.

Is there anything I need to know about the use of forward slashes on a img tag?


#2

You could read the Posts in
No ending '/' for self-closing link element?
and keep in mind that it is Browser-specific…


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.