Difference between /> and >

Tell us what’s happening:
I just want to ask, is there any difference between putting /> and > at the end of an element for example ?

Thank you :wink:

Your code so far
Example one with / :

<img
        id="header-img"
        src="https://s3.amazonaws.com/freecodecamp/original_trombones.png"
        alt="original trombones logo"
      />

Example two without / :

<img
        id="header-img"
        src="https://s3.amazonaws.com/freecodecamp/original_trombones.png"
        alt="original trombones logo"
      >

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36.

Challenge: Build a Product Landing Page

Link to the challenge:

img element is a self closing tag.
In HTML5 you can either used /> or > to close it.
It doesn’t matter.

1 Like

Oh okay so there isn’t any difference. Thank you! :blush:

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