![]() |
VOOZH | about |
Most of the HTML elements are surrounded by start and end tags to specify the starting and end of the element.
There is a special group of elements that only have start tags and does not contain any content within it, these elements are called void elements. Void elements doesn't have ending tags and can only have attributes but do not contain any kind of content. These elements can have backslash before ending of start tag but that is completely optional. Example of such elements are <br>, <hr>, <img>, <input>, <link>, <base>, <meta>, <param>, <area>, <embed>, <col>, <track>, <source> etc.
Characteristics:
The following are some of the void elements.
HTML <br> tag: This tag is used to insert line breaks in text in HTML. It accepts clear attribute that indicates where to start the next line.
Example 1: In this example, we will use of the <br> tag.
Output:
👁 ImageHTML <hr> Tag: This tag is used to insert a horizontal rule in HTML documents to separate different document sections. It can have attributes like Align, no shade, width, size.
Example 2: In this example, we will see the use of the <hr> tag.
Output:
HTML <img> Tag: This tag is used to add images to HTML web pages. It can have attributes like src, alt, height, width, ismap, loading, etc.
Example 3: In this example, we will see the use of the <img> tag.
Output:
👁 ImageHTML <input> Tag: This tag is used to insert an input field that can accept different types of inputs based on the value of the type attribute. It can also have attributes like name, alt, placeholder, etc.
Example 4: In this example, we will see the use of the <input> tag.
Output:
👁 ImageHTML <link> Tag: This tag is used to define a link between an HTML document and an external resource. It can have attributes like rel, charset, disabled, href, etc.
Example 5: In this example, we will see the use of the <link> tag.
Output:
👁 ImageHTML <base> Tag: This tag is used to specify a base URL (that will be added at the start) for all the links present on that page. There can only be 1 base URL on a single page.
Example 6: In this example, we will see the use of the <base> tag.
Output:
HTML <meta> Tag: This is used to specify information about HTML web pages that are used by search engines. It can have attributes like name, content, charset, etc.
Example 7: In this example, we will see the use of the <meta> tag.
Output:
👁 Image