Lesson 4 of 21 – HTML Elements
20%
20%

HTML Elements

HTML elements are the building blocks of every webpage. They define the structure and content of a web page.

Definition: An HTML element usually consists of a start tag, content, and an end tag.

Example of HTML Element

Example
<p>This is a paragraph</p>

Start Tag → <p>
Content → This is a paragraph
End Tag → </p>

Basic Structure of HTML Elements

1. Start Tag

The opening part of an element. Example: <h1>

2. Content

The information placed between opening and closing tags.

3. End Tag

The closing part of the element. Example: </h1>

Common HTML Elements

Element Purpose
<h1> - <h6> Headings
<p> Paragraph
<a> Hyperlink
<img> Insert image
<ul> Unordered list
<ol> Ordered list
<li> List item
<div> Container block
<span> Inline container

Nesting Elements

HTML elements can be placed inside other elements. This is called Nesting.

Example
<p>
Visit <a href="https://google.com">Google</a>
</p>

Empty HTML Elements

Some HTML elements do not contain any content. These are called Empty Elements.

Element Purpose
<br> Line break
<hr> Horizontal line
<img> Display image

HTML is Not Case Sensitive

HTML tags are not case-sensitive.

<B> and <b> work the same way.

Key Points

  • HTML elements are building blocks of webpages.
  • Most elements have opening and closing tags.
  • Elements can be nested inside other elements.
  • Some elements are empty elements.
  • HTML creates a DOM tree structure.
💡 Remember: Every webpage is made up of HTML elements. Learning elements is the foundation of HTML.

🧠 Quiz

Which tag is used to create a hyperlink?