Web Development Worksheet: Final Test
Code tip (Read it like a browser): Find the topic: HTML, CSS, JavaScript or how the web works. Read the code line by line, the way a browser would. For sums and loops, write each step down and check it again.
NameDateTime takenScore ___ / 40
- 1.🔢 In a basic web page file, which comes FIRST? (a) <body> (b) <head> (c) <!DOCTYPE html> (d) </head>
-
2.⚖️ What colour is the text of this element?
<p class="big" id="top">Hi</p>
CSS:
p { color: white; }
#top { color: green; } (a) white (b) orange (c) red (d) green - 3.🔁 Which loop repeats code a set number of times? (a) if (b) for (c) let (d) else
-
4.🔁 How many times does this code print “Welcome”?
for (let i = 2; i <= 8; i++) {
console.log("Welcome");
} - 5.Which of these is the content? (a) the text or picture (b) the line round the box (c) space outside the border (d) space inside the border
- 6.🔠 Are headings shown in bold by default? (a) Yes (b) No
-
7.⚖️ What colour is the text of this element?
<h2 class="big" id="logo">Hi</h2>
CSS:
.big { color: red; }
h2 { color: green; } (a) purple (b) yellow (c) green (d) red -
8.⚡ What number does this code print?
let a = 42;
let b = 30;
console.log(a + b); -
9.📊 How many cells does this table have in all?
<table>
<tr><th>Name</th><th>Fruit</th><th>Price</th></tr>
<tr><td>Papaya</td><td>Jamun</td><td>Litchi</td></tr>
<tr><td>Guava</td><td>Banana</td><td>Guava</td></tr>
</table> -
10.⚡ What number does this code print?
let books = 7;
books = books + 4;
books = books - 3;
console.log(books); - 11.What is <input type="date"> for? (a) picks a day (b) sends the form (c) lets you pick only one (d) hides what you type
- 12.💬 How does an HTML comment end? (a) // (b) >> (c) */ (d) -->
- 13.🌈 Which hex code is red? (a) #00ffff (b) #ff0000 (c) #000000 (d) #ffff00
- 14.📄 Where does <p> go: in the head or in the body? (a) in the head (b) in the body
-
15.🌍 What is the path in this URL?
http://www.example.net/about.html (a) /about.html (b) www.example.net (c) /maths/tables.html (d) http -
16.🌍 What is the domain name in this URL?
https://kids.example.org/about.html (a) https (b) /about.html (c) school.example.in (d) kids.example.org -
17.⚡ What does this code show?
let name = "Riya";
console.log("Hello, " + name + "!"); (a) Hello, name! (b) Hello, Riya! (c) Riya (d) name - 18.🔗 Which attribute holds the address of a link? (a) id (b) href (c) src (d) alt
- 19.🖼️ Which attribute of <img> describes the picture? (a) height (b) alt (c) src (d) width
- 20.🌈 Which colour is #0000ff? (a) cyan (b) yellow (c) bright green (d) blue
- 21.Which of these is an empty tag? (a) <p> (b) <b> (c) <hr> (d) <ul>
- 22.📝 What do we need to write HTML? (a) a paintbrush (b) a microphone (c) a printer (d) a plain text editor
- 23.Which of these is padding? (a) a solid or dotted edge (b) the line round the box (c) the gap to other boxes (d) space inside the border
-
24.💬 Which text will NOT show on the page?
<!-- <p>Fun facts</p> -->
<p>Good morning!</p>
<p>I love mangoes.</p>
<p>Rain today</p> (a) Good morning! (b) I love mangoes. (c) Fun facts (d) Rain today - 25.Which of these is a strong password? (a) 111111 (b) Rain#Drop_42! (c) qwerty (d) password
-
26.🔁 What number does this code print?
let total = 0;
for (let i = 1; i <= 4; i++) {
total = total + 9;
}
console.log(total); - 27.🏷️ Which is the closing tag for <h2>? (a) <h2/> (b) <\h2> (c) </h2> (d) <h2>
-
28.✍️ How many declarations (property: value pairs) are in this rule?
p {
padding: 8px;
margin: 10px;
} -
29.⚡ What number does this code print?
let a = 2;
let b = 2;
console.log(a * b); - 30.🌍 Which one asks for a web page? (a) the browser (b) HTTPS (c) the server (d) the URL
- 31.🛡️ Online: is it safe to keep passwords secret? (a) not safe (b) safe
-
32.🖼️ How many pixels wide is the picture drawn?
<img src="moon.png" alt="The full moon" width="150"> - 33.Which of these is an empty tag? (a) <title> (b) <h1> (c) <img> (d) <b>
- 34.Which of these is padding? (a) the gap round content (b) the gap to other boxes (c) the text or picture (d) a solid or dotted edge
- 35.True or false: <p> has a closing tag. (a) False (b) True
-
36.🔁 What is the LAST number this code prints?
for (let i = 0; i < 11; i = i + 2) {
console.log(i);
} - 37.True or false: <th> gives the table a title. (a) False (b) True
-
38.🌍 What is the protocol in this URL?
https://kids.example.org/index.html (a) http (b) /index.html (c) https (d) kids.example.org - 39.🧭 Which semantic tag holds one blog post? (a) <main> (b) <article> (c) <footer> (d) <aside>
- 40.True or false: HTML makes a link. (a) False (b) True
Answer key
- <!DOCTYPE html>
- green
- for
- 7
- the text or picture
- Yes
- red
- 72
- 9
- 8
- picks a day
- -->
- #ff0000
- in the body
- /about.html
- kids.example.org
- Hello, Riya!
- href
- alt
- blue
- <hr>
- a plain text editor
- space inside the border
- Fun facts
- Rain#Drop_42!
- 36
- </h2>
- 2
- 4
- the browser
- safe
- 150
- <img>
- the gap round content
- True
- 10
- False
- https
- <article>
- True
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids