Most of the beginners think HTML Elements and Tags are same, but actually they are not.
HTML Tags are building blocks of html page. HTML Tags mainly contain three parts. Opening tag (start tag), Main Content and an End tag (closing tag), as shown in a below image.
HTML Element is everything written from the start tag and an end tag, including tags. While as HTML Tags are like keywords or simple instructions that tells the web browser how to display the text written between the tags.
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: