Crus4

logo

HTML Elements Vs Tags


Table of Contents

HTML Elements Vs Tags

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

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 <br> </b>.

Some other commonly used Empty Elements includes:

<img>, <input>, <link>, <meta> etc.


Related Posts

HTML Elements

Images in HTML

HTML Canvas

HTML Elements Vs Tags – crus4