HTML is a tree of containers, but void elements are the exceptions to the rule. They are the standalone markers that provide instructions without wrapping text.
1The Zero-Child Rule
The absolute defining characteristic of a Void element is that it cannot have any child nodes or text content. Because they cannot contain anything, it is technically illegal in HTML to write a closing tag for them. For example, writing </img> or </br> is a structural error that forces the browser's parser to guess your intent. The single tag itself represents the entire, complete unit in the Document Object Model (DOM).
2Common Instructional Voids
Beyond <br> (line breaks) and <img> (images), there are several highly common void elements you will use daily. The <hr> (Horizontal Rule) tag renders a thematic visual break. The <input> tag creates interactive user data fields. The <meta> tag, which lives invisibly in the <head>, feeds critical configuration data to the browser and search engines. None of these elements require or permit closing tags.
3The Trailing Slash Debate
In older, stricter versions of web markup (like XHTML), developers were forced to manually 'close' void elements by adding a trailing slash before the final bracket, such as <br /> or <img />. In modern HTML5, this trailing slash is completely optional.
While specific JavaScript frameworks like React/JSX still strictly require the slash due to their underlying XML parsers, in pure HTML5, a clean, slash-free <br> or <hr> is the professional and preferred standard.
