What is a Tag?

Definition: An HTML tag is used to define elements in a webpage. It tells the browser how to display the content.

Example:
<p>This is a paragraph</p>
Type 1

Container Tags

These tags wrap around content. They must have both opening and closing tags.

  • Opening tag → Starts the element
  • Closing tag → Ends the element
<p> Paragraph text </p>

The "forward slash" (/) signifies the close.

Type 2

Empty Tags

These tags do not have closing tags. They are used to insert something into the page rather than wrap around text.

Common Examples:
<br> (Line Break)
<img> (Image)
<hr> (Horizontal Rule)
1 / 3