-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlab5_exe_C.html
More file actions
283 lines (257 loc) · 9.61 KB
/
lab5_exe_C.html
File metadata and controls
283 lines (257 loc) · 9.61 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
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
<!--
=========================================================
Name : lab5_exe_C.html
Assignment : Lab 5, Exercise C
Author(s) : Mahdi Ansari, William Arthur Philip Louis
Submission : May 21, 2030
Description : DOM Elements.
=========================================================
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Responsive HTML Example</title>
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
min-height: 100vh; /* Ensures the body takes up at least the viewport height */
}
header,
footer {
background-color: #333;
color: white;
text-align: center;
padding: 1em 0;
}
.container {
width: 90%;
max-width: 1200px;
margin: auto;
flex-grow: 1; /* Allows the container to expand and fill the available space */
}
nav {
background-color: coral;
padding: 1px 10px;
}
nav a {
text-decoration: none;
}
nav ul {
list-style-type: none;
padding: 0;
display: flex; /* Apply flexbox to nav */
flex-wrap: wrap; /* Allows nav items to wrap on smaller screens */
}
nav ul li {
margin-right: 20px;
position: relative; /* Needed for absolute positioning of dropdowns */
}
nav ul li ul {
display: none;
position: absolute;
left: 0;
background-color: #fbce9d; /* Background for dropdown */
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Optional: for dropdown shadow */
z-index: 1000; /* Ensures dropdown is above other content */
}
nav ul li:hover ul {
display: block;
}
nav ul li ul li {
padding: 10px 10px;
white-space: nowrap;
}
@media (max-width: 600px) {
nav ul li {
display: block;
margin-right: 0;
width: 100%; /* Full width for mobile */
}
nav ul {
flex-direction: column; /* Stack nav items vertically on mobile */
}
}
.companyName {
border: 1px solid red;
}
</style>
</head>
<body>
<header>
<h1>Welcome to <span class="companyName"> </span> Website</h1>
</header>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li>
<a href="#">Services</a>
<ul>
<li><a href="#">Web Design</a></li>
<li><a href="#">Hosting</a></li>
</ul>
</li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
<div class="container">
<section>
<h2>About Us</h2>
<p>This is a paragraph about our company.</p>
<img src="./images/logo.svg" alt="Company logo" width="100px" />
<h3>Our Journey</h3>
<p>
Welcome to our <span class="companyName"> </span>, a place where
innovation meets excellence. Our story began in the year 2010, in the
heart of Calgary, with a small team of passionate individuals
dedicated to making a difference in the software. Over the years,
we've grown into a family of creative thinkers, problem solvers, and
technology enthusiasts committed to delivering outstanding solutions.
</p>
<h3>Our Mission</h3>
<p>
At our <span class="companyName"> </span>, our mission is to
empower businesses and individuals through cutting-edge technology and
bespoke services. We believe in pushing boundaries, challenging the
status quo, and constantly innovating to stay ahead of the curve. Our
goal is to create products and services that not only meet but exceed
the expectations of our clients and contribute positively to our
community.
</p>
<h3>Our Team</h3>
<p>
Our strength lies in our diverse team of experts who bring a wealth of
knowledge, experience, and creativity to the table. From seasoned
industry veterans to dynamic young talent, our team is a melting pot
of ideas and perspectives that drive our success. We are proud to have
a culture that fosters learning, growth, and collaboration.
</p>
<h3>Our Services</h3>
<p>
We specialize in a wide range of services including full stack
development. Each service is tailored to meet the unique needs of our
clients, ensuring maximum effectiveness and efficiency. Whether it's
through web design or hosting, we strive to deliver excellence at
every step.
</p>
<h3>Our Commitment</h3>
<p>
Customer satisfaction is at the core of everything we do. We are
dedicated to building strong, lasting relationships with our clients
based on trust, integrity, and mutual respect. Our commitment to
quality and excellence is unwavering, and we continuously seek
feedback to improve and evolve.
</p>
<h3>Join Our Journey</h3>
<p>
As we look to the future, we are excited about the endless
possibilities and new challenges that lie ahead. We invite you to join
us on this journey of growth and innovation. Together, let's shape a
brighter, more technologically advanced future.
</p>
</section>
<section>
<h2>Contact Us</h2>
<form>
<label for="name">Name:</label>
<input type="text" id="name" name="name" /><br />
<label for="email">Email:</label>
<input type="email" id="email" name="email" /><br />
<label for="message">Message:</label>
<textarea id="message" name="message"></textarea><br />
<input type="button" value="Submit" />
</form>
</section>
<article>
<h2>What is full-stack?</h2>
<p>
Full-stack development stands at the cutting edge of modern web and
software development, embodying a comprehensive approach to building
applications. A full-stack developer is akin to a versatile artisan,
skilled in both front-end and back-end technologies. They navigate
with ease through the layers of a technology stack, from crafting
engaging and intuitive user interfaces to engineering robust and
efficient server-side logic. With expertise in a range of languages
and frameworks — from HTML, CSS, and JavaScript for the front end, to
Node.js, Python, or Ruby for the back end — full-stack developers
offer a unique blend of cross-disciplinary skills. This holistic
understanding of both client and server sides allows them to see the
bigger picture, seamlessly integrate various components of an
application, and ensure a cohesive, functional, and user-friendly
experience. In an era where technology is rapidly evolving, full-stack
developers are the agile architects of the web, capable of building
dynamic and responsive websites, applications, and systems that drive
modern digital experiences.
</p>
</article>
<aside>
<h3>Related Links</h3>
<ul>
<li><a href="#">W3School</a></li>
<li><a href="#">AWS</a></li>
</ul>
</aside>
</div>
<footer>
<p>Copyright © 2024</p>
</footer>
<script>
document.addEventListener('DOMContentLoaded', function afterRender() {
// Task 1: Set the text content of all elements with the class 'companyName' and remove their border
document.querySelectorAll('.companyName').forEach((element) => {
element.textContent = 'Mark Jimenez';
element.classList.remove('companyName'); // Remove the entire class
});
// Task 2: Change the background color of the navigation bar
document.querySelector('nav').style.backgroundColor = 'gray';
// Task 3: Hide the section titled 'What is full-stack?'
const Question = document.querySelectorAll("h2")
Question.forEach((element) => {
if (element.textContent === "What is full-stack?") {
element.parentElement.style.display = "none";
}
});
// Task 4: Create a new <p> element and append it to the 'About Us' section
const newPP = document.createElement('p');
newPP.textContent = "Human soul transaction is not legal";
document.querySelector('Section').appendChild(newPP);
// Task 5: Add placeholders to input elements based on their corresponding label IDs
const input = document.querySelectorAll('label');
for (const i of input){
const id = i.getAttribute('for');
const y = document.getElementById(id);
y.setAttribute('placeholder', id);
}
// Task 6: Set the src attribute of the image
const yeet = document.querySelector('img');
yeet.setAttribute('src','./images/logo.svg')
// Task 7: Add a new item in the navigation menu
const li = document.createElement('li');
const ahh = document.createElement('a');
ahh.textContent = "BOOYAH";
li.appendChild(ahh);
document.querySelector('nav ul').appendChild(li);
// Task 8: Change the submit button text upon clicking and make it disabled
const butt= document.querySelector('input[type="button"]');
butt.addEventListener('click',function(){
butt.value = 'CLICKED';
butt.disabled = true;
})
// Task 9: Change the text color of each item in the 'Related Links' to green
const butty = document.querySelectorAll('aside ul li');
butty.forEach((element) => {
element.style.color = 'green';
});
// Task 10: Add a red solid border to the footer
document.querySelector('footer').style.border = 'red solid 2px'
});
</script>
</body>
</html>