Most of the beginners think HTML Elements and Tags are same, but actually they are not.
HTML Element is the content that is written between the start tag and an end tag. While as HTML Tags are like keywords or simple instructions that tells the web browser how to display the text written between the tags. HTML Tags mainly contain three parts: Opening tag (start tag), Main Content and Closing tag (end tag). For Example:
The text (Main Content) that we write between the start tag and an end tag is actually the HTML Element.
The tags just tells the browser how to display the content. To understand it more clearly let’s write a code where we keep the content same but only change the tags, to see how web browser displays the same content in different forms.
<html> <body> <h1>Some Content</h1> <b>Some Content</b> <p>Some Content</p> <i>Some Content</i> <hr>Some Content</hr> </body> </html>
void HTML Elements also called Empty or self closing html elements. Empty elements are those elements that are not closed or that are self closed. For example a
<br> element (which represent a line break) can be write in
<br> not like
Some other commonly used Empty Elements includes: