Recall & Review
beginner
What is a self-closing tag in HTML?
A self-closing tag is an HTML tag that does not need a separate closing tag. It ends with a slash before the closing angle bracket, like
<br />. It is used for elements that don’t wrap any content.Click to reveal answer
beginner
Give three examples of common self-closing tags in HTML.
Common self-closing tags include:<br>
<br />for line breaks<img />for images<input />for form inputs
Click to reveal answer
beginner
Why do self-closing tags not have separate closing tags?
Because these tags do not contain any content inside them, they don’t need a closing tag. The slash at the end tells the browser the tag is complete on its own.
Click to reveal answer
intermediate
Is
<br> valid without the slash in HTML5?Yes, in HTML5 the slash is optional for self-closing tags like
<br>. Browsers understand it as self-closing even without the slash.Click to reveal answer
intermediate
What is the difference between self-closing tags in HTML and XHTML?
In XHTML, self-closing tags must always have the slash (e.g.,
<br />) because it is XML-based and requires strict syntax. HTML5 is more flexible and allows the slash to be optional.Click to reveal answer
Which of these is a correct self-closing tag in HTML5?
✗ Incorrect
Only
<img> is a self-closing tag. Tags like <div>, <p>, and <span> need separate closing tags.What does the slash in a self-closing tag mean?
✗ Incorrect
The slash indicates the tag is complete and does not wrap any content.
Which tag is NOT typically self-closing?
✗ Incorrect
<section> is a container tag and requires a separate closing tag.In HTML5, is
<br> without a slash valid?✗ Incorrect
HTML5 allows self-closing tags without the slash.
Why do self-closing tags improve writing HTML?
✗ Incorrect
Self-closing tags make code shorter and easier to read by not requiring closing tags.
Explain what a self-closing tag is and why it is used in HTML.
Think about tags that don’t wrap text or other elements.
You got /4 concepts.
Describe the difference between self-closing tags in HTML5 and XHTML.
Consider the syntax rules of XML vs HTML.
You got /4 concepts.