Html element show the tags this tag is one is start tag and another is end tag then we write our content under the start and end tag. Now given bellow the start and end tag example code: <TagName>Write our Content in this section...</TagName>. On the other hand, some tag is self-closing tag. This tag doesn’t have any end tag. It tag is only start tag. Now given bellow the example of the self-closing tag: </TagName>. Now given bellow the general tag and self-closing tags example and explain the code:
<html> <head> <title>This is HTML</title> </head> <body> <!--write our design code under this section.--> <!--general tag--> <h1>My Name Is Farhan Sakib Jesy</h1> <!--self-closing tag--> <hr /> <p>My Name Is Farhan Sakib Jesy</p> <hr /> </body> </html>
Output of the code on the web browser:
In this section h1 and p tag are general tag and other hand hr tag is self-closing. Hr tag just show the border on the web browser. We can see hr tag doesn’t have any end tag.