Understanding HTML Tags and Elements (Beginner-Friendly Guide)

Search for a command to run...

No comments yet. Be the first to comment.
Comeing soon

In the previous blog of this JavaScript series, we explored JavaScript Operators: The Basics You Need to Know and learned how operators help us perform calculations, comparisons, and logical checks. B

In the previous blog of this JavaScript series, we learned about Variables and Data Types — how JavaScript stores information. Now the next question is: How do we actually work with those values? Th

If you're starting your JavaScript journey, one of the first concepts you'll encounter is Variables and Data Types. They are the foundation of everything in programming — from storing a user's name to

JavaScript Promises are one of the most misunderstood yet essential features in modern JavaScript development. Most articles explain the syntax. Very few explain: Why Promises exist How they actuall

Subhrangsu
18 posts
Imagine a webpage like the framework of a house — it needs structure before style and behavior are added. That structure comes from HTML.
Every webpage you see is built with HTML. But what exactly are HTML tags and elements, and how do they shape what you see on the screen?
Let’s break it down in simple terms.
HTML (HyperText Markup Language) is the language used to describe the structure of web pages. It tells the browser what parts of the content are headings, paragraphs, images, lists, links, and more. Browsers use this structure to render pages correctly. (Wikipedia)
🧠 Think of HTML like the skeleton of a webpage — everything else (CSS and JavaScript) adds style and behavior.
An HTML tag is a way of marking content so the browser knows what it represents.
Tags are written inside angle brackets:
<p>This is a paragraph</p>
Here:
<p> → opening tag</p> → closing tagThis is a paragraph → contentTags give meaning to content. Without tags, browsers would just display raw text.
A complete structure in HTML usually has:
Example:
<h1>Hello World!</h1>
But note: some HTML tags don’t need a closing part — more on that next.
An HTML element is the complete unit that consists of:
So this whole thing:
<p>Hello</p>
counts as one HTML element. (Wikipedia)
Some elements don’t wrap content — they just represent something by themselves.
These are called void elements or self-closing elements.
Examples:
<img
src="puppy.jpg"
alt="A cute puppy" />
<br />
They don’t have closing tags because they don’t contain content — they simply act. (Wikipedia)
HTML elements also behave differently visually:
Block elements take up the full width available and start on a new line.
Examples:
<div><p><h1> – <h6>Block elements are like paragraphs — clearly separated blocks.
Inline elements stay within the flow of text.
Examples:
<span><a><strong>Inline elements are like words inside a sentence — they don’t force new lines.
Inline vs block helps you control layout and content flow.
Modern HTML emphasizes meaningful structure.
Semantic elements give both the browser and developers information about content meaning and role. (w3schools.com)
Examples of semantic tags:
<header> – introductory or navigational section<nav> – navigation links<main> – primary page content<article> – standalone content<section> – thematic grouping<footer> – footer information<aside> – related but separate content<figure> / <figcaption> – media with captionsSemantic tags help:
These elements still work — but they don’t tell you what they mean. They are general containers used for layout or wrapping content. (Dremendo)
Examples include:
<div> – generic block container<span> – generic inline containerFor example, <div> doesn’t tell you what is inside — just that it’s a section. This is useful for styling but doesn’t explain purpose.
Here are some HTML tags you’ll see often:
| Tag | Meaning |
<html> | Root of an HTML document |
<head> | Meta info (title, CSS, meta tags) |
<body> | Visible page content |
<h1>–<h6> | Headings of different levels |
<p> | Paragraph |
<ul>, <ol> | Lists |
<li> | List item |
<a> | Hyperlink |
<img> | Image |
<div> | Non-semantic block container |
<span> | Non-semantic inline container |
Semantic tags like <header>, <nav>, <footer> improve clarity, while non-semantic tags like <div> and <span> are flexible for layout and styling. (w3schools.com)
Here’s a tiny HTML page showing different tags:
<!DOCTYPE html>
<html>
<head>
<title>My First Page</title>
</head>
<body>
<header>
<h1>Welcome!</h1>
</header>
<main>
<section>
<p>This page uses semantic tags.</p>
</section>
</main>
<footer>
<p>© 2025 My Website</p>
</footer>
</body>
</html>
One of the best ways to learn HTML is to explore real pages:
This helps you directly connect what you see with actual HTML code.
HTML is the foundation of web content. Once you understand:
…you’ll read, write, and debug web pages with much more confidence.
Using semantic HTML makes your pages easier to maintain, more accessible, and better understood by search engines and assistive technologies. (w3schools.com)