-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3html.html
596 lines (530 loc) · 15.5 KB
/
3html.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>3. HTML Tags Overview</title>
<style>
* {margin: 0; padding: 0; box-sizing: border-box;}
body, html {height: 100%; font-family: 'Poppins', sans-serif; overflow-x: hidden;}
.background-video {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
min-width: 100%;
min-height: 100%;
z-index: -1;
object-fit: contain;
background-color: black;
opacity: 0.5;
}
.section {
background-color: rgba(255, 255, 255, 0.3);
margin: 20px auto;
padding: 20px;
border-radius: 12px;
width: 90%;
max-width: 1000px;
box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}
h2, h3 {
color: #333;
margin-bottom: 15px;
}
p {
font-size: 18px;
margin-bottom: 20px;
line-height: 1.7;
}
textarea {
width: 100%;
height: 200px;
font-family: monospace;
font-size: 16px;
padding: 10px;
border: 2px solid aqua;
border-radius: 8px;
margin-top: 10px;
margin-bottom: 10px;
background: rgba(255,248,240,0.4);
}
button {
background-color: #28a745;
color: white;
border: aqua;
padding: 10px 20px;
font-size: 16px;
border-radius: 8px;
cursor: pointer;
margin-bottom: 20px;
}
iframe {
width: 100%;
height: 300px;
background: rgba(255,248,240,0.1) ;
border: 2px solid red;
border-radius: 8px;
margin-top: 15px;
}
</style>
</head>
<body>
<!-- Background Video -->
<video autoplay loop muted class="background-video">
<source src="Topicvid.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<div class="section">
<h2>3. HTML Tags Overview</h2>
<h3>I. Introduction (Tags kya hote hain?)</h3>
<p><strong>Explanation:</strong>
HTML tags wo special keywords hote hain jo web page ka structure aur formatting define karte hain. Har tag angle brackets < > ke andar likha jata hai. Example ke liye <code><p></code> ek paragraph start karta hai.
<br><br>
Tags ke bina browser ko ye samajhna mushkil hota hai ki text, image, ya button ko kaise dikhana hai.
</p>
<textarea id="code1">
<!DOCTYPE html>
<html>
<body>
<p>This is a paragraph written using <p> tag.</p>
</body>
</html>
</textarea>
<button onclick="runCode('code1', 'output1')">Run Code</button>
<iframe id="output1"></iframe>
<h3>II. Types of Tags (Paired, Self-closing)</h3>
<p><strong>Explanation:</strong>
Tags mainly do tarah ke hote hain:
<ul>
<li><strong>Paired Tags:</strong> Ye opening aur closing dono hote hain. Jaise <code><b>Bold Text</b></code>.</li>
<li><strong>Self-closing Tags:</strong> Inhe close karne ki jarurat nahi hoti. Ye khudme complete hote hain. Jaise <code><br></code> line break ke liye.
</li>
</ul>
</p>
<textarea id="code2">
<!DOCTYPE html>
<html>
<body>
<p>This is a paragraph.</p>
<br>
<p>This is another paragraph after a line break.</p>
</body>
</html>
</textarea>
<button onclick="runCode('code2', 'output2')">Run Code</button>
<iframe id="output2"></iframe>
<h3>III. Nesting Rules aur Case Sensitivity</h3>
<p><strong>Explanation:</strong>
<ul>
<li><strong>Nesting:</strong> Jab ek tag ke andar doosra tag lagaya jata hai to is process ko nesting kehte hain. Nesting me hamesha jo tag baad me open hua hai, usko pehle close karte hain (LIFO - Last In First Out).</li>
<li><strong>Case Sensitivity:</strong> HTML tags case-insensitive hote hain, yaani <code><HTML></code> ya <code><html></code> dono chalega. Lekin best practice hai ki hamesha lowercase ka use karein.</li>
</ul>
</p>
<textarea id="code3">
<!DOCTYPE html>
<html>
<body>
<p><b>This is a bold text inside paragraph.</b></p>
</body>
</html>
</textarea>
<button onclick="runCode('code3', 'output3')">Run Code</button>
<iframe id="output3"></iframe>
</div>
<script>
function runCode(textareaId, iframeId) {
var code = document.getElementById(textareaId).value;
var iframe = document.getElementById(iframeId);
iframe.contentDocument.open();
iframe.contentDocument.write(code);
iframe.contentDocument.close();
}
</script>
</body>
</html>
<div class="section">
<h3>IV. Basic Formatting Tags</h3>
<p><strong>Explanation:</strong>
Formatting tags ka use text ko style karne ke liye hota hai, jaise bold, italic, underline wagairah.
Ye tags content ko visually alag banate hain bina CSS ke.
</p>
<h4><b><b> - Bold Text</b></h4>
<p><strong>Explanation:</strong>
<code><b></code> tag se text bold dikhai deta hai, jisse important content highlight hota hai.
</p>
<textarea id="code4">
<!DOCTYPE html>
<html>
<body>
<b>This text is bold.</b>
</body>
</html>
</textarea>
<button onclick="runCode('code4', 'output4')">Run Code</button>
<iframe id="output4"></iframe>
<h4><b><i> - Italic Text</b></h4>
<p><strong>Explanation:</strong>
<code><i></code> tag ka use text ko italic (slanted) style dene ke liye hota hai, jaise kisi dialogue ya special word ke liye.
</p>
<textarea id="code5">
<!DOCTYPE html>
<html>
<body>
<i>This text is italic.</i>
</body>
</html>
</textarea>
<button onclick="runCode('code5', 'output5')">Run Code</button>
<iframe id="output5"></iframe>
<h4><b><u> - Underlined Text</b></h4>
<p><strong>Explanation:</strong>
<code><u></code> tag se text ke neeche ek underline aata hai. Important ya clickable content dikhane ke liye use hota hai.
</p>
<textarea id="code6">
<!DOCTYPE html>
<html>
<body>
<u>This text is underlined.</u>
</body>
</html>
</textarea>
<button onclick="runCode('code6', 'output6')">Run Code</button>
<iframe id="output6"></iframe>
<h4><b><mark> - Highlighted Text</b></h4>
<p><strong>Explanation:</strong>
<code><mark></code> tag text ko yellow highlight karta hai jaise hum important notes me karte hain.
</p>
<textarea id="code7">
<!DOCTYPE html>
<html>
<body>
<p>Here is a <mark>highlighted</mark> word!</p>
</body>
</html>
</textarea>
<button onclick="runCode('code7', 'output7')">Run Code</button>
<iframe id="output7"></iframe>
<h4><b><small> - Smaller Text</b></h4>
<p><strong>Explanation:</strong>
<code><small></code> tag se text ka size thoda chhota ho jata hai, jaise copyright notice ke liye.
</p>
<textarea id="code8">
<!DOCTYPE html>
<html>
<body>
<p>This is normal text. <small>This is smaller text.</small></p>
</body>
</html>
</textarea>
<button onclick="runCode('code8', 'output8')">Run Code</button>
<iframe id="output8"></iframe>
<h4><b><del> - Deleted Text</b></h4>
<p><strong>Explanation:</strong>
<code><del></code> tag dikhata hai ki koi text delete kiya gaya hai, usually ek line text ke upar aa jati hai (strikethrough).
</p>
<textarea id="code9">
<!DOCTYPE html>
<html>
<body>
<p>This is <del>deleted</del> text.</p>
</body>
</html>
</textarea>
<button onclick="runCode('code9', 'output9')">Run Code</button>
<iframe id="output9"></iframe>
<h4><b><ins> - Inserted Text</b></h4>
<p><strong>Explanation:</strong>
<code><ins></code> tag batata hai ki koi text insert ya add kiya gaya hai. Browser generally us text ko underline karta hai.
</p>
<textarea id="code10">
<!DOCTYPE html>
<html>
<body>
<p>This is <ins>inserted</ins> text.</p>
</body>
</html>
</textarea>
<button onclick="runCode('code10', 'output10')">Run Code</button>
<iframe id="output10"></iframe>
<h4><b><sub> - Subscript Text</b></h4>
<p><strong>Explanation:</strong>
<code><sub></code> tag se text chhota ho jata hai aur niche shift ho jata hai. Mostly chemical formulas me use hota hai (H<sub>2</sub>O).
</p>
<textarea id="code11">
<!DOCTYPE html>
<html>
<body>
<p>Water formula: H<sub>2</sub>O</p>
</body>
</html>
</textarea>
<button onclick="runCode('code11', 'output11')">Run Code</button>
<iframe id="output11"></iframe>
<h4><b><sup> - Superscript Text</b></h4>
<p><strong>Explanation:</strong>
<code><sup></code> tag se text chhota aur upar shift hota hai. Jaise mathematical power (a<sup>2</sup> + b<sup>2</sup> = c<sup>2</sup>).
</p>
<textarea id="code12">
<!DOCTYPE html>
<html>
<body>
<p>Equation: a<sup>2</sup> + b<sup>2</sup> = c<sup>2</sup></p>
</body>
</html>
</textarea>
<button onclick="runCode('code12', 'output12')">Run Code</button>
<iframe id="output12"></iframe>
</div>
<div class="section">
<h3>V. Text Level Tags</h3>
<p><strong>Explanation:</strong>
Text level tags ka use hum normal paragraphs, breaks, horizontal lines aur pre-formatted text ke liye karte hain.
Ye basic structure banane me madad karte hain.
</p>
<h4><b><p> - Paragraph</b></h4>
<p><strong>Explanation:</strong>
<code><p></code> tag ka use ek paragraph banane ke liye hota hai. Browser automatically thoda space add karta hai paragraph ke aage aur baad me.
</p>
<textarea id="code13">
<!DOCTYPE html>
<html>
<body>
<p>This is the first paragraph.</p>
<p>This is the second paragraph.</p>
</body>
</html>
</textarea>
<button onclick="runCode('code13', 'output13')">Run Code</button>
<iframe id="output13"></iframe>
<h4><b><br> - Line Break</b></h4>
<p><strong>Explanation:</strong>
<code><br></code> tag se text me new line insert hoti hai bina naye paragraph banaye. Ye self-closing tag hota hai.
</p>
<textarea id="code14">
<!DOCTYPE html>
<html>
<body>
<p>Line 1<br>Line 2<br>Line 3</p>
</body>
</html>
</textarea>
<button onclick="runCode('code14', 'output14')">Run Code</button>
<iframe id="output14"></iframe>
<h4><b><hr> - Horizontal Rule</b></h4>
<p><strong>Explanation:</strong>
<code><hr></code> tag ek horizontal line draw karta hai jo content ke sections ko visually alag karta hai.
Ye bhi self-closing tag hai.
</p>
<textarea id="code15">
<!DOCTYPE html>
<html>
<body>
<h2>Section 1</h2>
<p>Content of section 1.</p>
<hr>
<h2>Section 2</h2>
<p>Content of section 2.</p>
</body>
</html>
</textarea>
<button onclick="runCode('code15', 'output15')">Run Code</button>
<iframe id="output15"></iframe>
<h4><b><pre> - Preformatted Text</b></h4>
<p><strong>Explanation:</strong>
<code><pre></code> tag ke andar jo text hota hai wo exactly waise hi display hota hai jaise likha gaya ho, including spaces aur line breaks.
Programming code dikhane ke liye useful hai.
</p>
<textarea id="code16">
<!DOCTYPE html>
<html>
<body>
<pre>
This is preformatted text.
It preserves
all spaces and
line breaks exactly.
</pre>
</body>
</html>
</textarea>
<button onclick="runCode('code16', 'output16')">Run Code</button>
<iframe id="output16"></iframe>
</div>
<div class="section">
<h3>VI. Heading Tags</h3>
<p><strong>Explanation:</strong>
Heading tags ka use hum headings aur subheadings banane ke liye karte hain.
HTML me total 6 heading tags hote hain: <code><h1></code> se leke <code><h6></code> tak.
<br><br>
<b>Note:</b>
<ul>
<li><code><h1></code> sabse bada aur important heading hota hai.</li>
<li><code><h6></code> sabse chhota heading hota hai.</li>
<li>SEO ke liye <code><h1></code> ka use bahut important hota hai.</li>
</ul>
</p>
<textarea id="code17">
<!DOCTYPE html>
<html>
<body>
<h1>This is Heading 1</h1>
<h2>This is Heading 2</h2>
<h3>This is Heading 3</h3>
<h4>This is Heading 4</h4>
<h5>This is Heading 5</h5>
<h6>This is Heading 6</h6>
</body>
</html>
</textarea>
<button onclick="runCode('code17', 'output17')">Run Code</button>
<iframe id="output17"></iframe>
</div>
<div class="section">
<h3>VII. List Tags</h3>
<p><strong>Explanation:</strong>
Lists ka use hum items ko sequence me ya points ke form me dikhane ke liye karte hain.
HTML me 3 major types ke list tags hote hain:
<br><br>
<ul>
<li><b>Unordered List ( <code><ul></code> ):</b> Bullets ke saath items aate hain.</li>
<li><b>Ordered List ( <code><ol></code> ):</b> Numbers ya letters ke sequence me items aate hain.</li>
<li><b>Description List ( <code><dl></code> ):</b> Term aur uske description ke pair me items aate hain.</li>
</ul>
</p>
<!-- Unordered List Example -->
<h4>Unordered List Example</h4>
<textarea id="code18">
<!DOCTYPE html>
<html>
<body>
<h2>Unordered List Example</h2>
<ul>
<li>Apple</li>
<li>Banana</li>
<li>Orange</li>
</ul>
</body>
</html>
</textarea>
<button onclick="runCode('code18', 'output18')">Run Code</button>
<iframe id="output18"></iframe>
<!-- Ordered List Example -->
<h4>Ordered List Example</h4>
<textarea id="code19">
<!DOCTYPE html>
<html>
<body>
<h2>Ordered List Example</h2>
<ol>
<li>Wake up</li>
<li>Brush</li>
<li>Breakfast</li>
</ol>
</body>
</html>
</textarea>
<button onclick="runCode('code19', 'output19')">Run Code</button>
<iframe id="output19"></iframe>
<!-- Description List Example -->
<h4>Description List Example</h4>
<textarea id="code20">
<!DOCTYPE html>
<html>
<body>
<h2>Description List Example</h2>
<dl>
<dt>HTML</dt>
<dd>Hyper Text Markup Language</dd>
<dt>CSS</dt>
<dd>Cascading Style Sheets</dd>
<dt>JS</dt>
<dd>JavaScript</dd>
</dl>
</body>
</html>
</textarea>
<button onclick="runCode('code20', 'output20')">Run Code</button>
<iframe id="output20"></iframe>
</div>
<div class="section">
<h3>VIII. Table Tags</h3>
<p><strong>Explanation:</strong>
Table ka use hum data ko rows aur columns ke form me present karne ke liye karte hain.<br><br>
Table ke main tags:
<ul>
<li><b><table>:</b> Pura table structure.</li>
<li><b><tr>:</b> Table row banata hai.</li>
<li><b><td>:</b> Table cell/data hota hai (normal data).</li>
<li><b><th>:</b> Table header cell hota hai (bold aur center aligned).</li>
<li><b><thead>:</b> Table ka header group.</li>
<li><b><tbody>:</b> Main table body (rows/data).</li>
<li><b><tfoot>:</b> Table ka footer (last part).</li>
</ul>
</p>
<!-- Basic Table Example -->
<h4>Basic Table Example</h4>
<textarea id="code21">
<!DOCTYPE html>
<html>
<body>
<h2>Simple Table</h2>
<table border="1">
<tr>
<th>Sr. No.</th>
<th>Name</th>
<th>City</th>
</tr>
<tr>
<td>1</td>
<td>Ritesh</td>
<td>Delhi</td>
</tr>
<tr>
<td>2</td>
<td>Priya</td>
<td>Mumbai</td>
</tr>
</table>
</body>
</html>
</textarea>
<button onclick="runCode('code21', 'output21')">Run Code</button>
<iframe id="output21"></iframe>
<!-- Advanced Table Example (thead, tbody, tfoot) -->
<h4>Advanced Table Example with thead, tbody, tfoot</h4>
<textarea id="code22">
<!DOCTYPE html>
<html>
<body>
<h2>Detailed Table</h2>
<table border="1">
<thead>
<tr>
<th>Product</th>
<th>Price</th>
</tr>
</thead>
<tbody>
<tr>
<td>Laptop</td>
<td>₹50,000</td>
</tr>
<tr>
<td>Mobile</td>
<td>₹20,000</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>Total</td>
<td>₹70,000</td>
</tr>
</tfoot>
</table>
</body>
</html>
</textarea>
<button onclick="runCode('code22', 'output22')">Run Code</button>
<iframe id="output22"></iframe>
</div>