Which tag can be used as both empty and container tag
Answers
Answered by
2
A container tag has two ends (an opening and a closing) whereas an empty tag doesn't. The paragraph tag is an example of a container tag:
<p>Our paragraph text here.</p>
The image tag is a good example of an empty tag.
<img src="logo.png" alt="Image! ">
See how the initial paragraph tag (<p>) has a corresponding end tag? The text in between is "contained" by the tag.
Empty tags are the horizontal rule (<hr>) and the break tags (<br>).
In XHTML where all tags must be closed, they become <hr/> and <br/>
Most of the data a container tag contains is between the opening and closing tag (including other "nested" tags.) Whereas all of the data represented by an empty tag is contained in the tags attributes.
<p>Our paragraph text here.</p>
The image tag is a good example of an empty tag.
<img src="logo.png" alt="Image! ">
See how the initial paragraph tag (<p>) has a corresponding end tag? The text in between is "contained" by the tag.
Empty tags are the horizontal rule (<hr>) and the break tags (<br>).
In XHTML where all tags must be closed, they become <hr/> and <br/>
Most of the data a container tag contains is between the opening and closing tag (including other "nested" tags.) Whereas all of the data represented by an empty tag is contained in the tags attributes.
Similar questions