-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhtmlmodule2.html
More file actions
176 lines (159 loc) · 6.17 KB
/
htmlmodule2.html
File metadata and controls
176 lines (159 loc) · 6.17 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="javamodule.css">
<title>HTML Module 2 - HTML Elements, Attributes, and Multimedia</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
}
header {
background: #333;
color: #fff;
padding: 20px 0;
text-align: center;
}
nav ul {
list-style-type: none;
padding: 0;
}
nav ul li {
display: inline;
margin: 0 15px;
}
nav ul li a {
color: white;
text-decoration: none;
}
.container {
width: 80%;
margin: auto;
padding: 20px;
background: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h2 {
color: #333;
}
button {
background-color: #28a745; /* Green background */
color: white; /* White text */
border: none;
padding: 10px 15px;
margin: 10px 0;
cursor: pointer;
border-radius: 5px;
font-size: 16px;
}
button:hover {
background-color: #218838; /* Darker green on hover */
}
footer {
text-align: center;
padding: 20px;
background: #333;
color: white;
}
</style>
</head>
<body>
<header>
<h1>HTML Module 2: Elements, Attributes, and Multimedia</h1>
<nav>
<ul>
<li><a href="htmlmodule1.html">Module 1</a></li>
<li><a href="htmlmodule2.html">Module 2</a></li>
<li><a href="htmlmodule3.html">Module 3</a></li>
</ul>
</nav>
</header>
<div class="container">
<h2>1. Understanding HTML Elements</h2>
<p>An HTML element consists of a start tag, content, and an end tag, like <code><p>Content</p></code>. Elements can be nested to form a hierarchy.</p>
<button onclick="window.open('https://www.youtube.com/watch?v=G2eEThIWeP4', '_blank')">Watch Video on HTML Elements</button>
<h2>2. Block-level vs. Inline Elements</h2>
<p>Elements are classified as:</p>
<ul>
<li><strong>Block-level:</strong> Takes full width, e.g., <code><div></code>, <code><p></code>.</li>
<li><strong>Inline:</strong> Takes only necessary width, e.g., <code><span></code>, <code><a></code>.</li>
</ul>
<pre><code>
<div>
<p>Paragraph inside a block-level element.</p>
<span>Inline element.</span>
</div>
</code></pre>
<button onclick="window.open('https://www.youtube.com/watch?v=WT5y8S0JtQk', '_blank')">Watch Video on Block vs Inline Elements</button>
<h2>3. HTML Attributes</h2>
<p>Attributes provide additional info, written within the start tag. Examples include <code>href</code> and <code>src</code>.</p>
<pre><code>
<a href="https://www.example.com" target="_blank">Visit Example</a>
<img src="image.jpg" alt="Image description">
</code></pre>
<button onclick="window.open('https://youtu.be/yMX901oVtn8?si=30lK3Zx58eqjKXcC', '_blank')">Watch Video on HTML Attributes</button>
<h2>4. Adding Multimedia</h2>
<p>Use <code><img></code> for images and <code><video></code> for videos:</p>
<pre><code>
<img src="nature.jpg" alt="Nature" width="300" height="200">
<video controls width="500">
<source src="video.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</code></pre>
<button onclick="window.open('https://youtu.be/z6H22xGAZEA?si=V34fKMAw_7ENg8HO', '_blank')">Watch Video on Adding Multimedia</button>
<h2>5. Using Lists</h2>
<p>HTML supports:</p>
<ul>
<li><strong>Unordered Lists:</strong> <code><ul></code></li>
<pre><code>
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
</code></pre>
<li><strong>Ordered Lists:</strong> <code><ol></code></li>
<pre><code>
<ol>
<li>Step 1</li>
<li>Step 2</li>
</ol>
</code></pre>
</ul>
<button onclick="window.open('https://youtu.be/N69xumSjg5Q?si=u-IqvZUb4nW0aTaB', '_blank')">Watch Video on Using Lists</button>
<h2>6. HTML Tables</h2>
<p>Use <code><table></code>, <code><tr></code>, and <code><td></code> for structured data:</p>
<pre><code>
<table border="1">
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>John</td>
<td>25</td>
</tr>
</table>
</code></pre>
<button onclick="window.open('https://youtu.be/RGJkOztXUvc?si=mgCfisM46TphTAVI', '_blank')">Watch Video on HTML Tables</button>
<h2>7. Test Your Knowledge</h2>
<p>Take this quiz:</p>
<form action="submit_test.html" method="post">
<label for="q1">1. What is the difference between block-level and inline elements?</label>
<input type="text" id="q1" name="q1" required><br>
<label for="q2">2. How do you add an image to an HTML page?</label>
<input type="text" id="q2" name="q2" required><br>
<label for="q3">3. Write the HTML code for a link that opens in a new tab.</label>
<textarea id="q3" name="q3" required></textarea><br>
<button type="submit">Submit Answers</button>
</form>
</div>
<footer>
<p>© 2024 Code Wiz. All rights reserved.</p>
</footer>
</body>
</html>