Welcome to the Treehouse Community
Looking to learn something new?
Void Element and Self-Closing Tags
This is a total n00b question:
This seems very Square/Rectangle but, is it correct to say that a Void Element is a Self-Closing tag, but a Self-Closing tag is not always a Void Element?
<HR> and <BR> are both Void Elements and Self-Closing tags, but <META> and <DOCTYPE> are Self-Closing tags but not Void Elements?
Is this correct?
Void elements USE self-closing tags. Self-Closing tags are used for void elements.
It's a nuance but it's like this: A cat uses claws. A cat without claws is not a correct cat. Claws are only used on cats. Not true but sticking with the metaphor
A HTML image is a void element. A void element requires a self-closing tag by using:
<img... blah blah blah />
However, that being said, HTML5 doesn't require closing void elements, it's really a preference. If you're used to XHTML for example, you may as well keep the habit.