-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProblem Set 8
97 lines (78 loc) · 2.64 KB
/
Problem Set 8
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
##### index.html ######
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Webpage</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<link href="styles.css" rel="stylesheet">
</head>
<body>
<div class="container">
<h1>This is page 1</h1>
<h2>This is exercise CS50</h2>
<p>Abcdefg</p>
<p>Abcdefg</p>
<p>Abcdefg</p>
<p>Abcdefg</p>
<p>Abcdefg</p>
<h2>These are numbers</h2>
<p>123456789</p>
<button id="toggleButton" class="btn btn-primary">Toggle Content</button>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
<script src="script.js"></script>
</body>
</html>
##### style.css #####
/* styles.css */
/* Selector 1 */
h1 {
color: blue;
font-size: 24px;
}
/* Selector 2 */
.container {
background-color: #f5f5f5;
padding: 10px;
margin-top: 20px;
}
/* Selector 3 */
p {
font-style: italic;
}
/* Selector 4 */
#custom-heading {
font-weight: bold;
text-decoration: underline;
}
/* Selector 5 */
.custom-class {
font-family: Arial, sans-serif;
margin-bottom: 10px;
}
###### script.js #####
// script.js
// Get the button element
var toggleButton = document.getElementById("toggleButton");
// Get the container element
var container = document.querySelector(".container");
// Add event listener to the button
toggleButton.addEventListener("click", function() {
// Toggle the visibility of the container
container.classList.toggle("hide");
});
##### page1.html #### Make 2 or 3 same files
<!DOCTYPE html>
<html lang="en">
<head>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
<link href="styles.css" rel="stylesheet">
<title>My Webpage</title>
</head>
<body>
Page 1
</body>
</html>