OnlineCBT Logo OnlineCBT
HTML Tutorial
HTML · LESSON 51

HTML Div and Span

By Ratan Updated: 16 Oct 2026

Use <div> for generic block grouping and <span> for generic inline text styling.

Level: Beginner to Advanced
Duration: ~60 Mins Deep-Dive

1. The
Element (Division)

The

tag is a generic block-level container. It carries no semantic meaning on its own. Use
when you need a wrapper solely for styling with CSS classes or layout positioning (such as Flexbox and CSS Grid).

...
...

2. The Element

The tag is a generic inline container used to style or manipulate a specific piece of text inside a paragraph or heading without breaking onto a new line:

Status: Passed | Score: 98/100

3. When NOT to Use Div and Span

Whenever a semantic tag exists (e.g.,

,
, ,
Address Contact

+91 7877547686

E-mail

onlinecbtportal@gmail.com

Helpline Number

+91 7877547686


Click To Download
Get it on Google Play

ऐप डाउनलोड करने
के लिए Google Play पर
उपलब्ध है

WhatsApp Chat