-
Notifications
You must be signed in to change notification settings - Fork 28
/
index.html
132 lines (123 loc) · 3.58 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CSS Inspection</title>
<style>
body {
background-color: aliceblue;
text-align: center;
font-family: Arial, sans-serif;
}
h1 {
color: royalblue;
font-size: 3rem;
font-family: 'Times New Roman', sans-serif;
}
p {
font-size: 1rem;
font-weight: normal;
}
h2 {
font-weight: 500;
}
.quiz {
margin: 20px;
text-align: left;
}
.question {
font-size: 18px;
font-weight: normal;
text-align: left;
margin: 20px;
}
.answer {
font-size: 16px;
font-weight: normal;
text-align: left;
margin: 20px;
}
</style>
</head>
<body>
<h1>Inspect Me</h1>
<h2>This is an simple website to learn how to do CSS Inspection</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam
viverra euismod odio, gravida pellentesque urna varius vitae.
Suspendisse potenti. Morbi commodo, ipsum in blandit hendrerit,
velit enim ornare nisi, eget consequat libero libero eu libero.
Donec varius, sem eget ornare commodo, quam libero pretium
libero, euismod blandit mauris nunc in magna.
</p>
<hr />
<div class="quiz">
<div class="question">
Q.1 What is the named color of the body?
</div>
<div class="answer">
<input type="text" id="answer1">
<button onclick="checkAnswer1()">Submit</button>
<p id="result1"></p>
</div>
<div class="question">
Q.2 What is the font size of the h1?
</div>
<div class="answer">
<input type="text" id="answer2">
<button onclick="checkAnswer2()">Submit</button>
<p id="result2"></p>
</div>
<div class="question">
Q.3 What is the font weight of the h2?
</div>
<div class="answer">
<input type="text" id="answer3">
<button onclick="checkAnswer3()">Submit</button>
<p id="result3"></p>
</div>
<div class="question">
Q.4 What is the font family of the p?
</div>
<div class="answer">
<input type="text" id="answer4">
<button onclick="checkAnswer4()">Submit</button>
<p id="result4"></p>
</div>
</div>
</body>
<script>
function checkAnswer1() {
var answer = document.getElementById("answer1").value;
if (answer.toLowerCase() === "aliceblue" || answer.toLowerCase() === "alice blue") {
document.getElementById("result1").innerHTML = "Correct!";
} else {
document.getElementById("result1").innerHTML = "Incorrect. Try again.";
}
}
function checkAnswer2() {
var answer = document.getElementById("answer2").value;
if (answer.toLowerCase() === "3rem" || answer.toLowerCase() === "3 rem") {
document.getElementById("result2").innerHTML = "Correct!";
} else {
document.getElementById("result2").innerHTML = "Incorrect. Try again.";
}
}
function checkAnswer3() {
var answer = document.getElementById("answer3").value;
if (answer.toLowerCase() === "500") {
document.getElementById("result3").innerHTML = "Correct!";
} else {
document.getElementById("result3").innerHTML = "Incorrect. Try again.";
}
}
function checkAnswer4() {
var answer = document.getElementById("answer4").value;
if (answer.toLowerCase() === "arial" || answer.toLowerCase() === "arial, sans-serif" || answer.toLowerCase() === "sans-serif" || answer.toLowerCase() === "sans serif") {
document.getElementById("result4").innerHTML = "Correct!";
} else {
document.getElementById("result4").innerHTML = "Incorrect. Try again.";
}
}
</script>
</html>