Why is it necessary to put end tag?

Hi all!
Is there any difference between these two codes, one of which written with end tag (/) and the other one is not. They look same on the page

Lesson: https://www.codecademy.com/courses/learn-html/lessons/intro-to-html/exercises/body-html

HTML content is wrapped in tags, it is how the web browser can interpret both your content and how you want to structure it. Most elements will contain three things: an opening tag, the content, and a closing tag. In the lesson, <body> is the opening tag, and </body> is the closing tag. It is the way you tell the web browser that everything in between those two tags belongs to the ‘body’ element. Closing tags are always denoted by the slash “/” that comes before the name of the tag.

You will also learn about some elements that don’t have closing tags. Those are known as ‘void elements,’ and they exist because it is not possible to have any ‘content’ in them. <img> (image) tags are an example, but I will leave it up to you to learn more about them once you get to those lessons.

1 Like

I got it, it was very useful thank you so much :slight_smile:

1 Like