You are currently viewing Which Character is Used to Indicate an end tag in HTML?
  • Post category:HTML

Which Character is Used to Indicate an end tag in HTML?

In this article, we will discuss What is an HTML end tag and how important is it. And also discuss which character is used to indicate an end tag.

What is the end tag?

In HTML we create everything using a tag, between the start tag and end tag we write content. If we start a tag we should end it with an end tag For example if we start a <p>tag we should end it with an end tag </p>. For some HTML tags, we don’t need to give end tag forex: <img>, <input>, <br> because they are unpaired tags. We need to give end tags only to paired tags <span>, <div>, <li>, etc. The start tag doesn’t contain a forward slash but the end tag must have a forward slash (/).

The forward slash special character is used to Indicate an end tag.

Syntax of an end tag

 

</tagname>
  1. First, you need to put a less-than sign or character (<).
  2. The second character of an end tag must be a forward slash symbol (/). In HTML, the SOLIDUS or forward slash (/) character is used to indicate an end tag.
  3. Then you need to put a tag name or element name for ex: div, span, a, etc.,
  4. Finally, the greater-than sign or character (>) should be given.

Example:

<p> End-tag in HTML </p>

Output:which character is used to indicate an end tag?

In the above code, some text is given between starting <p> and end tag </p>. If you give the start tag in HTML you must give the end tag.

What happens if you don’t give an end tag?

<h1> Welcome
<p> Hello Everyone

Result:which character is used to indicate an end tag?

READ ALSO  How to Select a Default Value for an HTML Radio Button?

This example shows what happens if you don’t give an end tag. In the above HTML code, only the start tag is given for the h1 and p tags, and no end tag is given. Since no end tag is given, the text “hello everyone” in the <p> tag in the output is also displayed as a heading h1 tag. So, you should give an end tag in all HTML paired tags.

Conclusion

Through this article, I hope you know what is an HTML end tag and how important it is.

Leave a Reply