What are void (empty) elements in HTML?
Void elements (also called empty elements) are HTML elements that have no content, so they have no closing tag. They only have attributes.
<br>
<hr>
<img src="photo.jpg" alt="Photo">
<input type="text" name="name">
<meta charset="UTF-8">
<link rel="stylesheet" href="style.css">
Common void elements are br, hr, img, input, meta, link, source and col. In HTML5 you write them without the slash. In XHTML they were written as <br />. See HTML Elements and Tags.
Learn more about the similar topics:
| Tutorials |
|---|
| No Content Found. |
| Exercises & Assignments |
|---|
| No Content Found. |
| Interview Questions & Answers |
|---|
| No Content Found. |