Skip to main content

Command Palette

Search for a command to run...

Understanding HTML Tags and Elements

The building blocks of the web, made easy

Published
2 min readView as Markdown
Understanding HTML Tags and Elements
T

MERN Stack developer focused on building real-world web applications. Currently exploring Generative AI and modern backend practices. I write about what I learn, build, and break along the way.

1. What HTML Really Is

Imagine you want to build a simple house.

Before paint, furniture, or decorations, you first need structure:
walls, rooms, doors, windows.

That structure of a website is called HTML.

HTML = the skeleton of a webpage.

2.What Is an HTML Tag?

A tag is like a label.

Example:

<p> Tejas </p>

HTML is built like a box.

  • <p> → opening tag

  • Tejas → content

  • </p> → closing tag

3. What Is an HTML Element?

A tag is only the label but element is the whole thing.

So:

<p> Tejas </p>
  • <p> is a tag

  • </p> is a tag

  • <p>Tejas</p> is an HTML element

4. Self-Closing (Void) Elements

Some elements don’t need closing tags because they don’t hold content.

Example:

<img />
<br />
<input />

5. Block vs Inline Elements

Block elements

They take full width and start on a new line.

Examples:

<div>
<p>
<h1>

Inline elements

They stay inside a line.

Examples:

<span>
<a>
<strong>

6.Common HTML Tags You’ll Use

You don’t need 100 tags to build websites.

<h1> to <h6>  → headings  
<p>          → paragraph  
<div>        → box  
<span>       → small inline text  
<a>          → link  
<img>        → image  
<button>     → button

These are enough to build 80% of websites.

Pro Tip for Beginners

Open any website
Right-click → Inspect

You will see everything is just HTML boxes inside boxes.

7. Final thought

HTML gives structure and meaning to a webpage.
Once you understand tags and elements, building websites becomes simple and logical one element at a time.

Web from Zero: HTML & CSS for Real Developers

Part 1 of 4

In this series, I teach HTML and CSS from zero, focusing on how browsers render pages, how layouts work, and how real websites are built not just how to write tags and styles.

Up next

Emmet for HTML: A Beginner’s Guide to Writing Faster Markup

Stop typing boilerplate - let Emmet generate your HTML in seconds