Do all HTML tags require both a begin and end tag?

No. Most elements have an opening and a closing tag, like <p>...</p>. But empty (void) elements have no content, so they have no closing tag.

<!-- with closing tag -->
<p>Hello</p>

<!-- empty elements: no closing tag -->
<br>
<hr>
<img src="photo.jpg" alt="Photo">
<input type="text">
<meta charset="UTF-8">

HTML also lets you leave out the closing tag of some elements, like <li> and <p>, but it is a bad habit. Always close the tags that need it. See HTML Elements and Tags.


Learn more about the similar topics:
Tutorials
HTML Elements and Tags
Exercises & Assignments
Write a program to create a webpage to print values 1 to 5
Write a program to create a webpage to print your city name in red color.
Write a program to print a paragraph with different font and color.
Interview Questions & Answers
Do all HTML tags require both a begin and end tag?