Skip to content

This is one of our old lessons! Visit the Path page to see all of our latest courses.

Self-closing tags – HTML

Summary

<!-- This element creates a line break -->
<br>

<!-- This element creates a horizontal line to divide content -->
<hr>

Details

HTML code is made up of elements. Some elements are made up of a single self-closing tag, as you can see in the examples above.

A self-closing tag is made of an element’s symbol wrapped in angle brackets. It does not require a forward slash.

Elements that use self-closing tags are referred to as empty elements.

Demo

References

HTML basics on MDN