Elements, Tags, and Attributes
Complete reference for HTML elements — live practice tasks appear as each tag group is completed.
2. Empty Tags and Container Tags
HTML tags are categorized into two types based on whether they hold content or not:
Container Tags (Paired)
Have opening + closing tag, contain content.
<p>...</p><h1>...</h1><b>...</b><a>...</a><div>...</div><table>...</table>Empty Tags (Self-closing)
No closing tag, no content inside.
<br> — Line break<hr> — Horizontal rule<img> — Image<input> — Input field<meta> — Metadata<link> — External resource<!-- Container Tag Example -->
<p>This paragraph has opening and closing tags.</p>
<!-- Empty Tag Examples -->
<br>
<hr>
<img src="image.jpg" alt="My Image"><p> are container tags, while break tags like <br> and <hr> are empty tags.3. Body Tag and Attributes
The <body> tag defines the main visible content of a web page. Everything displayed on screen goes inside this tag.
<body bgcolor="lightyellow" text="darkblue"
background="bg.jpg">
<h1>Welcome to My Page</h1>
<p>This is the body content.</p>
</body>| Attribute | Description |
|---|---|
bgcolor | Sets the background color of the page |
text | Sets the default text color |
background | Sets a background image |
topmargin | Top margin of the page |
leftmargin | Left margin of the page |
bgcolor attribute will be used directly in your first profile project in Section 6!4. <p> Tag and Its Attributes
The <p> tag defines a paragraph. Browsers automatically add margin before and after each paragraph.
<p>This is a simple paragraph.</p>
<p align="center">This paragraph is center-aligned.</p>
<p align="right">This paragraph is right-aligned.</p>
<p align="justify">This paragraph text is justified.
It stretches the text so each line has equal width.</p>| Attribute | Description |
|---|---|
align | left (default), center, right, justify |
Important: HTML ignores extra white spaces and line breaks in source code. Multiple spaces become one. Use <br> for breaks and for extra spaces.
align="center" attribute is widely used for headings and introductory text.5. <pre> Tag
The <pre> tag defines preformatted text. It preserves spaces and line breaks exactly as written. Text is displayed in a fixed-width font (Courier).
<pre>
Name Age City
---- --- ----
Rahul 20 Delhi
Priya 22 Mumbai
Amit 19 Jaipur
</pre>Unlike <p>, the <pre> tag does not collapse spaces or line breaks.
<p>This has extra spaces.</p>
<!-- Browser shows: "This has extra spaces." -->
<pre>This has extra spaces.</pre>
<!-- Browser shows: "This has extra spaces." --><pre> tag is essential whenever you want to display formatted poems, quotes, or code blocks without writing multiple line break tags.6. <br> Tag & Practice Project
The <br> tag inserts a line break. It is an empty tag (no closing tag). Useful for addresses, poems, or anywhere you need a line break without a new paragraph.
<p>
Knobly Education<br>
123, Main Street<br>
New Delhi - 110001<br>
India
</p>
<!-- Poem example -->
<p>
Twinkle twinkle little star,<br>
How I wonder what you are.<br>
Up above the world so high,<br>
Like a diamond in the sky.
</p>| <br> | <p> |
|---|---|
| Only adds a line break | Adds line break with margin |
| Empty tag (no closing) | Container tag (has closing) |
| No extra spacing | Adds space above and below |
Task 1: My Profile Page
Ab aapne body bgcolor, p, pre, br, aur hr tags seekh liye hain! In tags ka use karke apna personal developer profile page banayein — bio, favorite quote in pre tag, aur contact address.
<body bgcolor><p align="center"><pre><br><hr>7. <hr> Tag and Attributes
The <hr> tag creates a horizontal rule (line) across the page. It is an empty tag (no closing tag). Used to separate content sections visually.
<!-- Basic horizontal line -->
<hr>
<!-- HR with width attribute -->
<hr width="50%">
<hr width="300">
<!-- HR with size (thickness) -->
<hr size="5">
<hr size="10">
<!-- HR with color -->
<hr color="red">
<hr color="#3b82f6">
<!-- HR with alignment -->
<hr align="left" width="50%">
<hr align="center" width="70%">
<hr align="right" width="40%">
<!-- HR without shadow (noshade) -->
<hr noshade>
<hr noshade size="3" color="darkblue" width="80%">
<!-- Complete Example -->
<h2>Chapter 1: Introduction</h2>
<p>This is the first chapter content.</p>
<hr color="orange" size="3" width="90%" align="center" noshade>
<h2>Chapter 2: Getting Started</h2>
<p>This is the second chapter content.</p>| Attribute | Description |
|---|---|
width | Width of the line in pixels or percentage (e.g., width="50%" or width="300") |
size | Thickness/height of the line in pixels (e.g., size="5") |
color | Color of the line (e.g., color="red" or color="#ff0000") |
align | Alignment: left, center (default), or right |
noshade | Removes the 3D shadow effect, makes line flat and solid |
HR vs BR Comparison:
<hr> — Draws a visible horizontal line to separate sections<br> — Only adds an invisible line break (no visible line)<hr color="red" size="3" width="80%" noshade>. The noshade attribute removes the default shadow effect for a cleaner look.9. HTML Formatting Elements
HTML provides several tags for formatting text:
<b>Bold Text</b>
<strong>Strong/Important Text</strong>
<i>Italic Text</i>
<em>Emphasized Text</em>
<u>Underlined Text</u>
<s>Strikethrough Text</s>
<del>Deleted Text</del>
<ins>Inserted Text</ins>
<mark>Highlighted Text</mark>
<small>Smaller Text</small>
<big>Bigger Text</big>
<sub>Subscript</sub> like H<sub>2</sub>O
<sup>Superscript</sup> like x<sup>2</sup>
<code>Inline Code</code>
<kbd>Keyboard Input</kbd>
<abbr title="HyperText Markup Language">HTML</abbr>
<blockquote>This is a blockquote.</blockquote>
<address>Contact: student@example.com</address>Quick Reference:
<b> — Bold<strong> — Strong<i> — Italic<em> — Emphasized<u> — Underline<del> — <mark> — Highlighted<small> — Small<sub> — H2O<sup> — x2<sub> and algebraic expressions like a2 + b2 using <sup>.10. Heading Tags (h1-h6)
HTML provides six levels of headings. <h1> is the largest and most important, <h6> is the smallest.
<h1>Heading 1 - Most Important</h1>
<h2 id="heading-2">Heading 2</h2>
<h3 id="heading-3">Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6 - Least Important</h6>
<h1 align="center">Centered Heading</h1>
<h2 id="right-aligned-heading" align="right">Right-aligned Heading</h2>H1 Heading
H2 Heading
H3 Heading
H4 Heading
H5 Heading
H6 Heading
Rules: Use only one <h1> per page. Do not skip heading levels. Headings help SEO.
<h1>Main Topic</h1>, followed by sub-headings <h2>Sub-Topic</h2>.11. <center> Tag and Alignment
The <center> tag is a container tag used to horizontally center-align text, headings, paragraphs, images, or entire sections on a web page.
<!-- Centering headings -->
<center>
<h1>Welcome to Knobly Education</h1>
<h3>Learn Web Development Step by Step</h3>
</center>
<!-- Centering formatted text -->
<center>
<p><b><u>Important Notice:</u></b> All exams start at 10:00 AM.</p>
</center>
<!-- Difference between <center> tag and align="center" attribute -->
<center><h3>Centered using <center> container tag</h3></center>
<h3 align="center">Centered using align="center" attribute</h3>
<!-- Centering images and content blocks -->
<center>
<img src="logo.png" alt="Logo" width="100">
<p>Empowering Students Across India</p>
<hr width="50%">
</center>Visual Alignment Demo:
⚠️ O-Level Exam Note:
The <center> tag is deprecated in HTML5 (where CSS text-align: center; is preferred). However, in NIELIT O-Level (M2-R5) and CCC exams, question papers frequently test the <center> tag and align="center" attribute!
Task 2: Basic HTML Tags & Formatting
Formatting tags (b, i, u), Headings (h1-h6), aur <center> tag complete hone ke baad ab Task 2 solve karein — bold, italic, underline, center-aligned text, preformatted text, aur multi-level headings.
<h1>, <h2><center><b>, <i>, <u><pre><br><hr>12. <font> Tag and Attributes
The <font> tag is used to change the color, size, and face (typeface) of text. It is a container tag that wraps around the text you want to style.
<!-- Font with color -->
<font color="red">This text is red.</font>
<font color="#3b82f6">This text is blue.</font>
<font color="green">This text is green.</font>
<!-- Font with size (1 to 7, default is 3) -->
<font size="1">Size 1 - Smallest</font>
<font size="2">Size 2</font>
<font size="3">Size 3 - Default</font>
<font size="4">Size 4</font>
<font size="5">Size 5</font>
<font size="6">Size 6</font>
<font size="7">Size 7 - Largest</font>
<!-- Font with face (typeface/font family) -->
<font face="Arial">This is Arial font.</font>
<font face="Times New Roman">This is Times New Roman.</font>
<font face="Courier New">This is Courier New (monospace).</font>
<font face="Verdana">This is Verdana font.</font>
<!-- Combining all attributes -->
<font color="darkblue" size="5" face="Arial">
Welcome to Knobly Education!
</font>
<!-- Nested font tags -->
<font color="red" size="4">
This is <font face="Courier New">mixed</font> styling.
</font>
<!-- Font used with other tags -->
<h2><font color="orange">Colored Heading</font></h2>
<p><font color="green" size="4" face="Verdana">Styled paragraph text.</font></p>| Attribute | Description |
|---|---|
color | Text color — name (red, blue) or hex code (#ff0000) |
size | Text size from 1 (smallest) to 7 (largest). Default is 3 |
face | Font family/typeface — Arial, Times New Roman, Courier New, Verdana, etc. |
Font Size Reference:
⚠️ Note:
The <font> tag is deprecated in HTML5 — modern websites use CSS for styling. But it is still important for O-Level exams and understanding HTML fundamentals!
<h1><font color="red" face="Arial">Welcome</font></h1>. Try different sizes and faces to see the visual difference.13. <img> Tag and Attributes
The <img> tag embeds images. It is a self-closing (empty) tag.
<img src="photo.jpg" alt="A photo" width="300" height="200">
<!-- Image with border -->
<img src="pic.jpg" alt="Picture" border="2">
<!-- Image as a link -->
<a href="https://knoblyweb.in">
<img src="logo.png" alt="Knobly" width="100">
</a>
<!-- Image with text wrap -->
<img src="photo.jpg" alt="Photo" align="left" hspace="10" vspace="10">
<p>This text wraps around the image.</p>| Attribute | Description |
|---|---|
src | Path/URL of the image (required) |
alt | Alternative text if image fails (required) |
width | Width in pixels or percentage |
height | Height in pixels or percentage |
border | Border around the image |
align | left, right, top, middle, bottom |
hspace | Horizontal space around image |
vspace | Vertical space around image |
Task 3: India - A Diverse Nation
Ab aapne <img> tag seekh liya hai! Task 3 me India ke bare me article banayein jisme headings, font colors, aur India ka map image embedded ho.
<img> (src, alt, align)<h1> - <h5><font color><p><hr>14. <marquee> Tag and Attributes
The <marquee> tag creates scrolling/moving text or images on a webpage. It is a container tag that makes its content move automatically.
<!-- Basic scrolling text (left to right default) -->
<marquee>Welcome to Knobly Education!</marquee>
<!-- Scroll Amount (speed control) -->
<marquee scrollamount="2">Slow scrolling text</marquee>
<marquee scrollamount="10">Fast scrolling text</marquee>
<marquee scrollamount="20">Very fast scrolling!</marquee>
<!-- Behavior: scroll, slide, alternate -->
<marquee behavior="scroll">Scroll (default) - loops continuously</marquee>
<marquee behavior="slide">Slide - stops at the edge</marquee>
<marquee behavior="alternate">Alternate - bounces back and forth</marquee>
<!-- Direction: left, right, up, down -->
<marquee direction="right">Moving Right →</marquee>
<marquee direction="up" height="80">Moving Up ↑</marquee>
<marquee direction="down" height="80">Moving Down ↓</marquee>
<!-- Loop count -->
<marquee loop="3">This scrolls only 3 times.</marquee>
<marquee loop="1">This scrolls only once!</marquee>
<marquee loop="-1">Infinite loop (default)</marquee>
<!-- Height and Width -->
<marquee width="50%" height="50" bgcolor="lightyellow">
Half-width marquee with background color
</marquee>
<!-- Combined Example -->
<marquee behavior="alternate" scrollamount="5"
bgcolor="#1e293b" width="100%" height="40">
<font color="white" size="4">★ Breaking News: HTML is Fun! ★</font>
</marquee>
<!-- Image in marquee -->
<marquee scrollamount="8" behavior="alternate">
<img src="logo.png" alt="Logo" width="60">
</marquee>| Attribute | Description |
|---|---|
scrollamount | Speed of scrolling in pixels per frame (default: 6). Higher = faster |
behavior | scroll (default, continuous), slide (stops at edge), alternate (bounces) |
direction | Scroll direction: left (default), right, up, down |
loop | Number of times to repeat. -1 or default = infinite |
height | Height of the marquee area in pixels or percentage |
width | Width of the marquee area in pixels or percentage |
bgcolor | Background color of the marquee area |
scrolldelay | Delay between each frame in milliseconds (default: 85) |
Behavior Comparison:
scroll — Text scrolls continuously in one direction and repeats from the other sideslide — Text slides in and stops when it reaches the edgealternate — Text bounces back and forth between the edges like a ping-pong ball⚠️ Note:
The <marquee> tag is deprecated in HTML5 — modern websites use CSS animations. But it is still asked in O-Level exams and useful for learning text animation concepts!
<marquee behavior="alternate" scrollamount="5">Breaking News!</marquee>. Try changing scrollamount to see speed differences.Task 4: Indian History Timeline
Image alignment (align='right'), marquee, font size/color, aur historical period sections ka use karke Indian History Timeline banayein.
<img align="right"><marquee><font face/size/color><h1> - <h3><hr color>15. <a> Anchor Tag
The <a> tag creates hyperlinks.
<!-- External link -->
<a href="https://www.google.com">Visit Google</a>
<!-- Open in new tab -->
<a href="https://www.google.com" target="_blank">Open in New Tab</a>
<!-- Email link -->
<a href="mailto:info@knoblyweb.in">Send Email</a>
<!-- Phone link -->
<a href="tel:+919876543210">Call Us</a>
<!-- Bookmark link (same page) -->
<a href="#section3">Jump to Section 3</a>
...
<h2 id="section3">Section 3</h2>
<!-- Download link -->
<a href="notes.pdf" download>Download Notes</a>| Attribute | Description |
|---|---|
href | URL of the link destination (required) |
target | _self (same tab), _blank (new tab), _parent, _top |
title | Tooltip text on hover |
download | Downloads file instead of navigating |
name | Name of anchor (for bookmarks) |
Task 7: Simple Webpage with Bookmarks & Navigation
Hyperlinks aur internal bookmarks (<a href='#about'>, <a name='about'>, <a href='#top'>) seekhne ke baad bina CSS ke ek pure semantic clickable website banayein.
<a href>target="_blank"Page Bookmarks (<a name>)mailto:<h1> - <h4><p><hr>17. Table Tag and Attributes (Complete Master Guide)
HTML me data ko grid format me yani Rows (पंक्तियाँ) aur Columns (कॉलम) me tabular roop se organize karne ke liye Table tags ka use kiya jaata hai. Ek standard HTML table 5 mukhya tags se milkar banti hai:
<table>Main Table Container
<caption>Table Title / Heading
<tr>Table Row (Horizontal)
<th>Header Cell (Bold + Center)
<td>Data Cell (Normal + Left)
A. <table> Tag (Parent Container)
Yeh table ka main boundary tag hota hai. Sabhi rows aur cells isi ke andar aate hain. Iske attributes poori table ke appearance, size, border, aur internal/external spacing ko define karte hain:
| Attribute | Description |
|---|---|
border | Table ke borders ki motai pixels me (jaise border="1" ya border="2"). Agar border="0" ho toh borders invisible hote hain. |
cellpadding | Cell ke border aur text content ke beech ka internal space / padding (pixels me, jaise cellpadding="8"). |
cellspacing | Do adjacent cells ke beech ka external gap / doori (pixels me, jaise cellspacing="0" sharp grid look ke liye). |
width | Table ki poori chaudai (percentage jaise width="100%" ya pixels me width="600"). |
height | Table ki vertical unchai (pixels me, jaise height="250"). |
align | Poori table ka webpage par horizontal alignment ("left", "center", "right"). |
bgcolor | Poori table ka background color (color name ya HEX code, jaise bgcolor="#f8fafc"). |
bordercolor | Table ke borders ka color specify karta hai (jaise bordercolor="#0284c7"). |
background | Table ke background me image lagane ke liye (jaise background="pattern.jpg"). |
<!-- <table> tag ke attributes ka live use -->
<table border="2" cellpadding="10" cellspacing="2" width="100%" align="center" bgcolor="#f8fafc" bordercolor="#0284c7">
<caption><b>Products & Price List</b></caption>
<tr bgcolor="#0284c7">
<th><font color="white">Item</font></th>
<th><font color="white">Quantity</font></th>
<th><font color="white">Price</font></th>
</tr>
<tr align="center">
<td>Mechanical Keyboard</td>
<td>5</td>
<td>₹2,500</td>
</tr>
<tr align="center">
<td>Optical Mouse</td>
<td>10</td>
<td>₹850</td>
</tr>
</table>B. <caption> Tag (Table Title & Heading)
Table ka title ya main topic heading display karne ke liye <caption> tag ka use hota hai. Yeh hamesha <table> tag ke turant baad pehla child tag hona chahiye.
| Attribute | Description |
|---|---|
align | Caption ki vertical position set karta hai: "top" (table ke upar, default) ya "bottom" (table ke neeche). |
<table border="1" width="80%" align="center" cellpadding="6">
<!-- Caption table ke upar title display karega -->
<caption align="top"><b>Monthly Sales Report - 2026</b></caption>
<tr bgcolor="#e2e8f0" align="center">
<th>Month</th>
<th>Revenue</th>
</tr>
<tr align="center">
<td>January</td>
<td>₹45,000</td>
</tr>
</table>C. <tr> Tag (Table Row)
<tr> ka full form Table Row hai. Yeh table me ek horizontal line (row) banata hai. Row ke andar ya toh <th> (headings) aate hain ya <td> (data cells). Iske attributes us row ke sabhi cells par ek sath apply ho jaate hain:
| Attribute | Description |
|---|---|
align | Us row ke sabhi cells ka horizontal text alignment: "left", "center", "right", "justify". |
valign | Us row ke sabhi cells ka vertical alignment: "top" (upar), "middle" (beech me, default), "bottom" (neeche). |
bgcolor | Us specific row ka background color (jaise header row ya zebra striping ke liye). |
bordercolor | Us specific row ke border ka color specify karta hai. |
<table border="1" width="100%" cellpadding="8">
<!-- Row 1: Header row with purple background & centered text -->
<tr bgcolor="#7e22ce" align="center">
<th><font color="white">Emp ID</font></th>
<th><font color="white">Employee Name</font></th>
<th><font color="white">Department</font></th>
</tr>
<!-- Row 2: Data row with align="center" and light purple background -->
<tr bgcolor="#faf5ff" align="center" valign="middle">
<td>E-101</td>
<td>Amit Sharma</td>
<td>Web Development</td>
</tr>
<!-- Row 3: Data row with different alignment -->
<tr align="center" valign="middle">
<td>E-102</td>
<td>Pooja Verma</td>
<td>UI/UX Design</td>
</tr>
</table>D. <th> Tag (Table Header Cell)
<th> ka full form Table Header hai. Yeh table ke columns ya rows ki headings ke liye use hota hai. By default iska text Bold (गाढ़ा) hota hai aur Center Aligned hota hai.
| Attribute | Description |
|---|---|
colspan | Horizontal columns ko merge karne ke liye number specify karta hai (jaise colspan="3" teen columns merge karega). |
rowspan | Vertical rows ko merge karne ke liye number specify karta hai (jaise rowspan="2" do rows merge karega). |
align | Header cell ka horizontal text alignment: "left", "center", "right". |
valign | Vertical text alignment: "top", "middle", "bottom". |
bgcolor | Header cell ka specific background color. |
width | Header cell ki width pixels ya percentage me. |
height | Header cell ki unchai (height in pixels). |
nowrap | Header text ko bina wrap hue single line me rakhta hai. |
<table border="1" width="100%" cellpadding="8" cellspacing="0">
<tr bgcolor="#0f766e">
<!-- colspan="2" se do columns merge hokar ek broad header banenge -->
<th colspan="2"><font color="white">Student Details</font></th>
<!-- normal th -->
<th bgcolor="#047857"><font color="white">Grade</font></th>
</tr>
<tr align="center">
<td>Roll No: 101</td>
<td>Rahul Kumar</td>
<td>A+</td>
</tr>
</table>E. <td> Tag (Table Data Cell)
<td> ka full form Table Data hai. Yeh table ka basic data container cell hota hai jisme actual text, numbers, images, ya links store hote hain. By default iska text Regular (Normal font) aur Left Aligned hota hai.
| Attribute | Description |
|---|---|
colspan | Data cell ko horizontal roop se multiple columns me merge karna (jaise colspan="2"). |
rowspan | Data cell ko vertical roop se multiple rows me merge karna (jaise rowspan="2"). |
align | Cell content ka horizontal alignment: "left", "center", "right". |
valign | Cell content ka vertical alignment: "top", "middle", "bottom". |
bgcolor | Individual data cell ka custom background color. |
width | Cell ki custom width (pixels ya % me). |
height | Cell ki custom height (pixels me). |
nowrap | Cell text me automatic line break hone se rokna. |
<table border="1" width="100%" cellpadding="8" cellspacing="0">
<tr bgcolor="#334155">
<th><font color="white">State</font></th>
<th><font color="white">City</font></th>
<th><font color="white">Status</font></th>
</tr>
<tr>
<!-- rowspan="2" se Uttar Pradesh 2 rows me merge hoga -->
<td rowspan="2" align="center" bgcolor="#f1f5f9"><b>Uttar Pradesh</b></td>
<td>Lucknow</td>
<td bgcolor="#dcfce7" align="center">Active</td>
</tr>
<tr>
<td>Kanpur</td>
<td bgcolor="#dcfce7" align="center">Active</td>
</tr>
</table>🔍 Quick Comparison: <th> (Header) vs <td> (Data)
| Feature | <th> (Table Header) | <td> (Table Data) |
|---|---|---|
| Default Font Weight | Bold (गाढ़ा) | Regular (सामान्य) |
| Default Text Alignment | Center (बीच में) | Left (बाईं तरफ) |
| Primary Purpose | Column ya Row ki heading batana | Actual data content display karna |
G. Complete Master Table (Colspan, Rowspan & Zebra Styling)
Neeche diye gaye complete code me border, cellpadding, cellspacing, <caption>, bgcolor, colspan, aur rowspan sabhi ka real-world use dekhein:
<table border="1" cellpadding="8" cellspacing="0" width="100%" bgcolor="#ffffff">
<caption align="top"><b>Student Examination Scoreboard 2026</b></caption>
<!-- Top Super-Header using colspan -->
<tr bgcolor="#1e293b" align="center">
<th rowspan="2"><font color="white">Roll No</font></th>
<th rowspan="2"><font color="white">Student Name</font></th>
<th colspan="3"><font color="white">Marks Obtained</font></th>
<th rowspan="2"><font color="white">Status</font></th>
</tr>
<!-- Sub-headers for Subjects -->
<tr bgcolor="#334155" align="center">
<th><font color="white">HTML</font></th>
<th><font color="white">CSS</font></th>
<th><font color="white">JS</font></th>
</tr>
<!-- Student 1 -->
<tr align="center">
<td>101</td>
<td align="left">Aarav Sharma</td>
<td>88</td>
<td>92</td>
<td>85</td>
<td bgcolor="#dcfce7"><font color="#15803d"><b>PASS</b></font></td>
</tr>
<!-- Student 2 with zebra background -->
<tr align="center" bgcolor="#f8fafc">
<td>102</td>
<td align="left">Priya Patel</td>
<td>95</td>
<td>90</td>
<td>94</td>
<td bgcolor="#dcfce7"><font color="#15803d"><b>PASS</b></font></td>
</tr>
</table>Task 5.1: Operating Systems (Table Layout)
Table, border, cellpadding, aur alternating colors ka use karke OS market share table banayein.
<table><tr><th><td>bordercellpaddingTask 5.2: Global Internet Usage Statistics
Rowspan aur Colspan ka advanced use karke regional internet usage data table banayein.
colspan="2"rowspan="2"<caption><th><td>alignTask 5.3: History of the Internet (Table & Timeline)
Description lists, ordered timeline, aur styled data tables (<table border='1'>, <caption>, <tr>, <th>, <td>) ka use karke History of Internet ka educational page banayein.
<table><caption><tr><th><td><dl><ol>fontTask 6: Weekly Study Schedule
Complex multi-row aur multi-column timetable banayein jisme days, timeslots, aur subject cells merged hon.
colspan="5"rowspan="2"bgcolorcellspacing="0"caption18. Form Tag and Elements
The <form> tag collects user input.
<form action="/submit" method="POST">
<label>Name:</label><br>
<input type="text" name="name" placeholder="Enter name"
size="30" maxlength="50"><br><br>
<label>Password:</label><br>
<input type="password" name="password"><br><br>
<label>Email:</label><br>
<input type="email" name="email"><br><br>
<p>Gender:</p>
<input type="radio" name="gender" value="male"> Male
<input type="radio" name="gender" value="female"> Female
<p>Hobbies:</p>
<input type="checkbox" value="coding"> Coding
<input type="checkbox" value="reading"> Reading
<br><br><label>Course:</label>
<select name="course">
<option value="">-- Select --</option>
<option value="olevel">O-Level</option>
<option value="ccc">CCC</option>
</select>
<br><br><label>Message:</label><br>
<textarea rows="4" cols="40"></textarea>
<br><br>
<input type="file"><br><br>
<input type="color" value="#22d3ee">
<input type="range" min="1" max="10">
<br><br>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>| Attribute | Description |
|---|---|
action | URL where form data is sent |
method | GET (in URL) or POST (in body) |
enctype | Encoding type (for file uploads) |
Task 8: Student Registration Form
Ab aapne sabhi form elements seekh liye hain! Task 8 me complete Student Registration Form banayein jisme Personal Info, Account Info, Radio, Checkbox, Dropdown, aur Textarea ho.
<form><fieldset><legend><input type><select><textarea>submit19. <div> and <span> Tags
<div> is a block-level container. <span> is an inline container.
<!-- div - Block level -->
<div style="background:#eee; padding:20px; margin:10px 0;">
<h2 id="section-title">Section Title</h2>
<p>Content in a div.</p>
</div>
<!-- span - Inline -->
<p>My name is <span style="color:blue; font-weight:bold;">
Rahul</span> and I study <span style="color:orange;">
Computer Science</span>.</p>| Feature | <div> | <span> |
|---|---|---|
| Type | Block-level | Inline |
| Width | Full width | Content width |
| New Line | Yes | No |
| Use | Group sections | Style inline text |
<div> to group entire layout blocks and <span> to style specific words or phrases inline.20. HTML5 Semantic Elements
Semantic elements describe their meaning clearly, helping browsers and search engines understand page structure.
<header>
<nav>
<a href="/">Home</a> |
<a href="/about">About</a>
</nav>
</header>
<main>
<article>
<h1>Article Title</h1>
<p>Content...</p>
</article>
<section>
<h2 id="section-title">Section Title</h2>
</section>
<aside>
<h3 id="related-links">Related Links</h3>
</aside>
</main>
<footer>
<p>© 2025 Knobly Education</p>
</footer>Semantic Tags:
<header> — Page header<nav> — Navigation<main> — Main content<article> — Independent content<section> — Thematic group<aside> — Sidebar<footer> — Page footer<figure> — Image + captionTask 11: Premium Demo Website Layout
HTML5 semantic elements (<header>, <nav>, <footer>) aur structured tables ka use karke ek modern business demo website banayein.
<header><nav><footer><table><form><h1> - <h3>©21. Audio and Video Tags
HTML5 supports audio and video directly.
<!-- Audio -->
<audio controls>
<source src="song.mp3" type="audio/mpeg">
Browser does not support audio.
</audio>
<!-- Video -->
<video width="640" height="360" controls poster="thumb.jpg">
<source src="video.mp4" type="video/mp4">
Browser does not support video.
</video>
<!-- YouTube Embed -->
<iframe width="560" height="315"
src="https://www.youtube.com/embed/VIDEO_ID"
allowfullscreen></iframe>Attributes:
controls — Show play/pause buttonsautoplay — Auto-start playingloop — Repeat playbackmuted — Start mutedposter — Video thumbnail imageTask 9: Solar System Basics (with Video Player)
Solar System page jisme detailed facts table ke sath embedded HTML5 video player (<video controls>) ho.
<video controls><source><table><ol><form><img>Task 5.4: The Wonders of Space
Space exploration multimedia page with facts table, celestial lists, aur astronomical links.
video/media<table><ul><ol><dl><img>22. <iframe> Tag
The <iframe> tag embeds another HTML page within the current page.
<!-- Embed a webpage -->
<iframe src="https://www.example.com"
width="600" height="400"></iframe>
<!-- Embed Google Maps -->
<iframe src="https://www.google.com/maps/embed?pb=..."
width="600" height="450"
style="border:0;" allowfullscreen
loading="lazy"></iframe>
<!-- Link targeting iframe -->
<iframe src="page.html" name="myframe"
width="100%" height="500"></iframe>
<a href="page2.html" target="myframe">Load Page 2</a>target="myframe" on an anchor tag to open links directly inside an embedded iframe!23. HTML Entities & Capstone Project
Reserved characters in HTML must be displayed using entities.
| Char | Entity | Code | Description |
|---|---|---|---|
| < | < | < | Less than |
| > | > | > | Greater than |
| & | & | & | Ampersand |
| " | " | " | Double quote |
|   | Non-breaking space | |
| © | © | © | Copyright |
| ® | ® | ® | Registered |
| ™ | ™ | ™ | Trademark |
| ₹ | ₹ | ₹ | Rupee |
| ♥ | ♥ | ♥ | Heart |
| → | → | → | Right arrow |
| ★ | ★ | ★ | Star |
<p>5 < 10 and 10 > 5</p>
<p>Price: ₹500</p>
<p>© 2025 Knobly Education</p>
<p>I ♥ HTML</p>Task 10: Full Multi-Section Website Layout (Capstone Project)
Badhaai ho! Ab aapne HTML ke sabhi chapters complete kar liye hain! Task 10 me nav, marquee, tables, forms, videos, lists, aur iframes ko mila kar ek complete master website banayein.
<iframe><video><nav><table><form><dl><ul>©
8. HTML Comment Tag
HTML comments are used to add notes, explanations, or reminders in the source code. Comments are not displayed in the browser — they are only visible in the source code.
Comment Uses:
⚠️ Important Rules:
<!--and end with--><body>tag explaining the purpose of your page. Example:<!-- My Profile Page - Created for O-Level Practice -->