HTML Elements

An HTML element is defined by a starting tag and closing tag. If element contain some other content, then it will end with closing tag. You can show some example as below.

Start Tag


End Tag


This is paragraph content.



This is heading content.



This is division content.


<br />




So here <p>, <h1>, <div> is an HTML element. But here some other HTML elements which don't need to be closed, like as <img />, <hr />, <br /> elements. These are known as void elements.

HTML Tag vs. Element

An HTML element is defined by starting tag. But if the element contains some content then it is closing with closing tag.

For example, <p> is starting tag of the paragraph and </p> is closing tag of the paragraph, but <p>This is paragraph</p> is a paragraph element.

Nested HTML Elements

If the one HTML element inside another HTML element, then it's called Nested HTML elements. You can see example code as below

<!DOCTYPE html>

      <title>Nested Elements Example</title>

      <h1>This is <i>italic</i> heading example</h1>
      <p>This is <u>underlined</u> paragraph example</p>


You can see above example code output as below