DEV Community

Cover image for HTML tags - container vs empty
Melina Caroline Bernard
Melina Caroline Bernard

Posted on

HTML tags - container vs empty

•HTML code is based on tags.

•Tags are used to add elements to a web page

•Elements are surrounded by angular brackets <> to make it a tag

👉🏻Example
Button - <button>
Image - <image>
Paragraph text - <p>

There are 2 types of tags

1.container tags - it should contain opening tags as well as closing tags <>..</>

👉🏻Example
<button> </button>
<p> </p>
<a> </a>

2.Empty tags - these don't need a closing tag.

👉🏻Example
<img>
<hr>
<br>

Top comments (0)