Everyone who might have written even a single HTML document would have used a void element.In HTML4 they were described as empty elements but in HTML5 these elements have been renamed as "void elements".
Most HTML elements have a start tag and an end tag that indicate where the element begins and where it ends. There is a group of elements that are exceptions to this rule. These elements are called empty or void and only have a start tag since they can’t have any content.
According to the HTML5 specification void elements are not allowed to contain text, character data or comments under any circumstances and must have a start tag but are not allowed to have an end tag.
These elements can have attributes but can’t have any content. Examples of such elements are: img, br, hr, and meta elements.
One thing that may confuse people is that just because an element does not have any content in a specific example does not make it a void element. So, for example, if you have a paragraph tag without any content inside it like this: <p></p>, then that does not mean the p tag is a void element.
Example:
Most HTML elements have a start tag and an end tag that indicate where the element begins and where it ends. There is a group of elements that are exceptions to this rule. These elements are called empty or void and only have a start tag since they can’t have any content.
According to the HTML5 specification void elements are not allowed to contain text, character data or comments under any circumstances and must have a start tag but are not allowed to have an end tag.
These elements can have attributes but can’t have any content. Examples of such elements are: img, br, hr, and meta elements.
One thing that may confuse people is that just because an element does not have any content in a specific example does not make it a void element. So, for example, if you have a paragraph tag without any content inside it like this: <p></p>, then that does not mean the p tag is a void element.
Example:
<input type="submit" value="Ok" />
We do not do the folowing:
<input type="submit" value="Ok"></input> <!-- Bad! -->