Previous Next

HTML Elements

HTML elements form the building blocks of HTML pages. An HTML element is comprised of a start tag, content, and an end tag. HTML has some empty, self-closing elements that contain no content.

Example:

<p> This is a paragraph </p>

In this example:

Nested HTML Elements

Nested HTML elements are the structure where an HTML element is contained within another.

Example:

<div>
   <h1> This is a heading </h1>
   <p> This is a paragraph </p>
</div>

In this example, the <h1> and <p> tag is contained within the <div> tag.

What is an Empty HTML Element?

An HTML element that is not empty is one that has a closing tag or contains content. These elements are also known as "self-closing elements."

Example:

<br>

This is an empty line break tag with no closing tag. It is used to insert a line break within text or other inline elements.

Previous Next