HTML Tags and Elements

Home / HTML

What Are HTML Tags?

HTML pages are created using tags.
A tag is a keyword inside angle brackets like this:
<tagename>
Most tags come in pairs:
<opening tag> content </closing tag>

Example:

<p> Hello World </p >

What Are HTML Elements?

An HTML element includes:

  • Opening tag
  • Content
  • Closing tag

Example:

<p>This is a paragraph.</p>
Here:

  • <p>→ opening tag
  • This is a paragraph. → content
  • </p>→ closing tag

Together = HTML element

Types of HTML Tags

✔ 1. Paired Tags
These tags need a closing tag.
Examples:
<h1>Heading</h1>
<p>Paragraph</p>

✔ 2. Self-Closing (Empty) Tags
These do not contain content and do not need a closing tag.
Examples:
<br> <!– Line Break –>
<hr> <!– Horizontal Line –>
<img src-“image.jpg”>

Note: In HTML5, self-closing slash / is optional.

Commonly Used HTML Tags

Example: Using Different Tags


    <!DOCTYPE html>
    <html>
    <head>
        <title>My First Web Page</title>
    </head>
    <body>
        <h1>HTML Tags Example!</h1>
        <p>This is a paragraph.</p>
         <p>This text is <strong>bold</strong> and this is <em>italic.</em></p>
         <a href="https://example.com">Visit Example</a>
         <br><br>
         <img src="image.jpg" alt="Sample Image">
         <hr>
    </body>
    </html>
    

Output (Explanation)

  • <h1> shows a big heading
  • <p> adds paragraphs
  • <strong> makes text bold
  • <em> makes text italic
  • <a> creates a clickable link
  • <img> displays an image
  • <hr> creates a horizontal line

Practice Tasks

1️⃣ Create a webpage with:

  • A big heading
  • Two paragraphs
  • One bold word and one italic word
  • A link
  • A horizontal line
  • An image

2️⃣ Add your name at the bottom using a paragraph.

About Us

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis.

About School

About Us

Services

Community

Testimonial

Help Centre

Quick Links

Classes

Events

Programs

Become Teacher

Contact Us