Learn how to use all six heading tags (<h1> to <h6>) to structure your web page content.
To write an HTML program that demonstrates the use of all six heading tags — <h1> through <h6> — and understand their hierarchy and styling.
HTML provides six levels of headings, from <h1> (most important) to <h6> (least important). Headings are used to structure content, create hierarchy, and improve accessibility and SEO.
<h1> for the main title, <h2> for major sections, and so on.
| Tag | Default Font Size | Purpose | Example Usage |
|---|---|---|---|
<h1> |
2.2em (largest) | Main page title / Most important | Page title, article title |
<h2> |
1.8em | Major sections | Chapter headings, main sections |
<h3> |
1.5em | Subsections | Subtopics within sections |
<h4> |
1.2em | Sub‑subsections | Detailed breakdowns |
<h5> |
1.0em | Minor headings | Less important headings |
<h6> |
0.85em (smallest) | Least important | Footnotes, fine print |
| Practice | Why It Matters |
|---|---|
Use <h1> only once per page |
It represents the main topic of the page |
| Follow proper hierarchy (h1 → h2 → h3) | Creates a logical structure for readers and search engines |
| Don't skip heading levels | Going from h1 to h3 without h2 breaks the structure |
| Use headings for structure, not just for styling | Headings convey semantic meaning, not just visual appearance |
| Keep headings descriptive and concise | Helps users and search engines understand the content |
<h1> is the largest and most important heading.<h6> is the smallest and least important.You have successfully:
<h1> to <h6>).ایک HTML پروگرام لکھنا جو تمام چھ ہیڈنگ ٹیگز — <h1> سے <h6> — کے استعمال کو ظاہر کرتا ہے اور ان کے درجہ بندی اور اسٹائل کو سمجھتا ہے۔
HTML ہیڈنگ کی چھ سطحیں فراہم کرتا ہے، <h1> (سب سے اہم) سے <h6> (سب سے کم اہم) تک۔ ہیڈنگز کا استعمال مواد کو ساخت دینے، درجہ بندی بنانے، اور رسائی اور SEO کو بہتر بنانے کے لیے کیا جاتا ہے۔
<h1>، بڑے حصوں کے لیے <h2>، اور اسی طرح استعمال کریں۔
| ٹیگ | ڈیفالٹ فونٹ سائز | مقصد | استعمال کی مثال |
|---|---|---|---|
<h1> |
2.2em (سب سے بڑا) | مرکزی صفحہ کا عنوان / سب سے اہم | صفحہ کا عنوان، مضمون کا عنوان |
<h2> |
1.8em | بڑے حصے | باب کے عنوان، اہم حصے |
<h3> |
1.5em | ذیلی حصے | حصوں کے اندر ذیلی موضوعات |
<h4> |
1.2em | ذیلی‑ذیلی حصے | تفصیلی تقسیم |
<h5> |
1.0em | معمولی ہیڈنگز | کم اہم ہیڈنگز |
<h6> |
0.85em (سب سے چھوٹا) | سب سے کم اہم | فوٹ نوٹ، چھوٹی تحریر |
| طریقہ | یہ کیوں اہم ہے |
|---|---|
فی صفحہ صرف ایک <h1> استعمال کریں |
یہ صفحہ کے مرکزی موضوع کی نمائندگی کرتا ہے |
| صحیح درجہ بندی کی پیروی کریں (h1 → h2 → h3) | قارئین اور سرچ انجن کے لیے منطقی ڈھانچہ بناتا ہے |
| ہیڈنگ لیولز کو نہ چھوڑیں | h1 سے h3 پر جانا بغیر h2 کے ڈھانچہ کو توڑتا ہے |
| ہیڈنگز کو ساخت کے لیے استعمال کریں، صرف اسٹائل کے لیے نہیں | ہیڈنگز معنوی معنی رکھتی ہیں، صرف بصری شکل نہیں |
| ہیڈنگز کو وضاحتی اور مختصر رکھیں | صارفین اور سرچ انجن کو مواد سمجھنے میں مدد کرتا ہے |
<h1> سب سے بڑی اور سب سے اہم ہیڈنگ ہے۔<h6> سب سے چھوٹی اور سب سے کم اہم ہیڈنگ ہے۔آپ نے کامیابی سے:
<h1> سے <h6>) استعمال کرتا ہے۔