HTML Empty Element

HTML Elements without any content i.e., that do not print anything are called Empty elements. Empty HTML elements do not have an ending tag. For instance. <br>, <hr>, <link>, <input> etc are HTML elements.

Example 2: In this example <br> tag doesn’t print anything. It is used as a line break that breaks the line between <h2> and <p> tags.

HTML
<!DOCTYPE html>
<html>

<head>
    <title>Empty HTML Elements</title>
</head>

<body>
    <h2>Welcome To GfG</h2>
    <br />
    <p>Hello Geeks.</p>

</body>

</html>

Output:

HTML empty element

HTML Elements

An HTML Element is a collection of start and end tags with the content inserted between them. HTML elements are building blocks of web pages, representing different types of content such as headings, paragraphs, links, and images.

Similar Reads

What Are HTML Elements?

HTML (Hypertext Markup Language) is the backbone of web development. It allows us to create structured and interactive web pages. In this article, we’ll learn about the important aspects of HTML elements, their syntax, and best practices....

Some key points about HTML elements

1. Syntax:...

Nested HTML Elements

When an HTML element is used inside another, it’s called a nested element.For instance, the  tag contains the  and  tags, forming a nested structure....

Necessary to add an end Tag

It is important to include the closing tag of an HTML element in order to ensure that the content is displayed correctly. While it is recommended to add closing tags to non-void HTML elements, modern browsers are becoming more forgiving and will not throw an error if you forget to include them. However, this can cause issues when you add additional HTML elements later on. Therefore, it is best practice to always include the closing tag for non-void HTML elements....

HTML Empty Element

HTML Elements without any content i.e., that do not print anything are called Empty elements. Empty HTML elements do not have an ending tag. For instance.
,


, , etc are HTML elements....

Supported Browser

Google Chrome: 1 Microsoft Edge: 12 Mozilla Firefox: 1 Opera: 2 Safari: 1...

Contact Us