What is the difference between HTML elements and tags?

What is the difference between HTML elements and tags?

HTML Tags and Elements are both important factors in the usage of the HTML. While many may consider that they are the same, the truth of the matter is that they are different.

HTML Tags are used to mark up the start and end of an HTML element. For example: <p> </p>; <p> is the starting tag, and </p> is the end tag.

HTML Elements, on the other hand, is slightly different. An element represents some kind of structure or semantics and generally consists of a start tag, content, and an end tag. For example:

<p>

This is the content of the paragraph element.

</p>

Hence, it can be said that HTML tags are part of HTML elements.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.