Empty Tags
How to correct empty XHTML/HTML tags.
Empty tags, also known as self-closing tags or void elements, are HTML elements that do not require a closing tag. These elements represent content or elements that do not have any inner content or do not require a closing tag for their intended functionality.
Many HTML elements require an opening tag and a corresponding closing tag to enclose the intended content. For example, a paragraph element is written as <p>…</p>, where the content goes between the opening <p> tag and the closing </p> tag.
Certain HTML elements are designed to be self-closing and are represented by empty tags, where the closing tag is omitted.
Here are four examples of commonly used HTML empty tags:
- <br> – A line break within a text block.
- <img> – An image element to embed images in a web page.
- <input> – An input control element, such as text fields, checkboxes or radio buttons for user input.
- <meta> – The metadata about an HTML document, such as character encoding, viewport settings, and search engine optimization information.