HTML Elements

Photo by DATAIDEA

In the first lesson, we have studied about tags and things like start tag and end tag.

An HTML element is usually composed of a “start tag”, “element content” and “end tag”

Example:

This example HTML Element above is composed of the following:

Nested HTML Elements

There are some cases that an HTML element can contain one or more HTML elements.

For you to better understand it look at the example below.

The example nested HTML Elements above are composed of the following:

  • Start tag. <p>
  • Start tag. <i>
  • Element Content. Italicized text
  • End tag </i>
  • End tag </p>

On the example above, there are two start tags and two end tags

The second tag ie. <i> italicizes the text within.

Empty Elements

Empty Elements are elements that do not have an element content and an end tag.

A list of commonly used Empty Elements:

  • <meta />
  • <link />
  • <img />
  • <br />
  • <hr />
  • <input />

The best practice in HTML Empty Elements is to always put a forward slash / sign before the greater than sign.

In this way, they are closed at their start tags.

To be among the first to hear about future updates of the course materials, simply enter your email below, follow us on (formally Twitter), or subscribe to our YouTube channel.

Back to top