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 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.

  <h1>Some Content</h1>
  <b>Some Content</b>
  <p>Some Content</p>
  <i>Some Content</i>
  <hr>Some Content</hr>

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