What are Non Semantic Tags in HTML?
Non semantic tags are HTML tags that do not tell you what kind of content they contain. They are just general-purpose containers with no clear meaning.
Let’s understand step-by-step.
1. What Does “Non Semantic” Mean?
The word “non semantic” means “no meaning.” So, non semantic tags don’t tell anything about what’s inside them.
For example, if you see:
<div>This is something</div>
You have no idea what “something” is. It could be: - a paragraph - a form - a sidebar - a heading - or anything else. This is why it’s called non semantic — it doesn’t give meaning to the content.
2. Why Are Non Semantic Tags Used?
Even though they don’t have meaning, non-semantic tags are still very useful. Here’s why developers use them:
a) Flexible Containers
You can put any content inside a non semantic tag. It acts like an empty box or a wrapper.
b) Grouping Elements
They help you group multiple elements together to apply styles or scripts.
For example:
<div class="card"> <h2>Title</h2> <p>Description</p> </div>
Here, the <div> groups the title and paragraph so you can style them as one unit.
c) Used with CSS and JavaScript
You can add classes or IDs to these tags to apply CSS styles or add JavaScript functionality.
3. Common Non Semantic Tags
Here are the most common non semantic tags:
| Tag | Meaning (in simple words) |
|---|---|
| <div> | A container or block-level box (used for layout) |
| <span> | An inline container (used for small styling) |
1. <div>: It’s short for “division”. It’s used to create sections or blocks in a webpage.
Example: <div class="footer">This is footer</div>
2. <span>: It’s used for inline elements, like styling a single word or phrase inside a sentence.
Example: <p>This is a <span class="highlight">special</span> word.</p>
4. When Should You Use Non Semantic Tags?
- There is no suitable semantic tag for your content
- You are just grouping elements for design or scripting
- You want full control using CSS or JavaScript
- You are creating custom layouts that don’t fit standard tag meanings
Will be learn
Non-semantic tags are like blank boxes in HTML. They don’t explain what’s inside, but they help you group and control content using CSS or JavaScript.
The most common non semantic tags are:
-
<div>— for block-level containers -
<span>— for inline-level containers
Use them wisely when there is no meaningful tag available.

Top comments (0)