Element & Tags

What are Elements & Tags in HTML?

HTML elements are building blocks of HTML documents that instruct and/or inform computer programs that are reading them with regards to the expected behavior of those elements, their visual presentation, and the probable meaning of their contents (if an element includes content).

HTML elements are denoted by so-called HTML tags. Tags themselves are never displayed to the end human user.

An HTML element starting tag starts with < and ends with >. For example: <div>.

An HTML element closing tag starts with </ and ends with >. For example: </div>.

The starting tag <div> along with the corresponding closing tag </div> constitute a div element. A div element can include content.

<div>
  What a great element!
</div>

Primary Elements

An HTML document include one catch-all element - namely html element. The html element in turn includes within itself two elements: head and body. Generally, all HTML documents have the following structure.

<!DOCTYPE html>
<html>
  <head>
    ...
  </head>
  <body>
    ...
  </body>
<html>