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.⚡ What number does this code print?
let a = 4;
let b = 2;
console.log(a * b); - 2.⚖️ Two rules with the same selector set a colour. Which one wins? (a) neither (b) the later one (c) the shorter one (d) the first one
- 3.Which of these is safe to do online? (a) log out on shared PCs (b) post your home address (c) share your password (d) click prize links
-
4.🔁 What is the LAST number this code prints?
for (let i = 0; i < 9; i = i + 3) {
console.log(i);
} -
5.🖌️ What colour are the letters?
li {
background-color: white;
text-align: center;
font-size: 40px;
color: orange;
} (a) white (b) orange (c) blue - 6.💬 Why do coders write comments? (a) to make links (b) to add colour (c) to show pictures (d) to leave notes
- 7.🌈 Which colour is #00ff00? (a) blue (b) yellow (c) white (d) bright green
- 8.🌗 Is white on black easy or hard to read? (a) easy to read (b) hard to read
- 9.True or false: <meta> has a closing tag. (a) False (b) True
- 10.🌈 How many pairs of hex digits are in a colour like #ff8800? (a) 4 (b) 3 (c) 6 (d) 2
- 11.📄 Where does the text of <title> appear? (a) nowhere (b) at the bottom (c) in a big heading (d) on the browser tab
- 12.✍️ In color: blue; which part is the property? (a) color (b) : (c) ; (d) blue
- 13.True or false: <ul> shows bullet points. (a) False (b) True
- 14.🚀 Which file should this code go in: <a href="a.html">Go</a> (a) script.js (b) index.html (c) style.css
- 15.📊 In a table, which tag is a row? (a) <th> (b) <td> (c) <tb> (d) <tr>
- 16.🚀 Which program lets you see your web page while you build it? (a) a photo viewer (b) a music player (c) a calculator (d) a web browser
-
17.🔁 What does this code print?
let marks = 12;
if (marks >= 25) {
console.log("Pass");
} else {
console.log("Try again");
} (a) Try again (b) Pass - 18.🧭 Which semantic tag holds one blog post? (a) <footer> (b) <header> (c) <article> (d) <nav>
-
19.🌍 What is the protocol in this URL?
https://www.example.com/art/gallery.html (a) /art/gallery.html (b) www.example.com (c) http (d) https - 20.🎯 Which sign starts an id selector? (a) . (b) @ (c) & (d) #
-
21.⚡ What does this code print? (Look at the quotes!)
let x = "5";
let y = 4;
console.log(x + y); (a) Error (b) 9 (c) 54 - 22.Which of these is the border? (a) the gap round content (b) a solid or dotted edge (c) space inside the border (d) the text or picture
-
23.🖌️ What colour are the letters?
h1 {
background-color: black;
font-size: 40px;
text-align: left;
color: orange;
} (a) black (b) orange (c) blue -
24.🔗 Where does this link open?
<a href="news.html" target="_blank">Art corner</a> (a) in the same tab (b) in a new tab - 25.🎨 One CSS file can style how many pages? (a) many pages (b) only one image (c) no pages (d) only one word
-
26.🔁 What does this code print?
let age = 48;
if (age >= 5) {
console.log("teen");
} else {
console.log("child");
} (a) child (b) teen -
27.📋 How many items does this list show?
<ul>
<li>Jamun</li>
<li>Banana</li>
<li>Grapes</li>
</ul> - 28.🔗 Which tag makes a clickable link? (a) <link> (b) <img> (c) <p> (d) <a>
- 29.🌈 In #002400 the green part is the hex number 24. What is it as a normal number?
-
30.🔁 What does this code print?
let age = 27;
if (age >= 40) {
console.log("teen");
} else {
console.log("child");
} (a) teen (b) child - 31.Which of these does JavaScript do? (a) changes the text size (b) makes a form box (c) rounds box corners (d) changes the page live
- 32.🎯 Can many elements share the same class? (a) Yes (b) No
-
33.🔁 What number does this code print?
let total = 0;
for (let i = 1; i <= 10; i++) {
total = total + 5;
}
console.log(total); - 34.True or false: in <img>, alt tells which image to load. (a) False (b) True
-
35.💪 How much empty space (px) is before the first box?
.row {
display: flex;
width: 410px;
justify-content: flex-end;
}
Inside are 4 boxes, each 100px wide (no margins). - 36.🎯 What kind of selector is .card? (a) an id selector (b) an element selector (c) a class selector
- 37.🌈 In #rrggbb, which colour do the last two digits give? (a) white (b) green (c) red (d) blue
-
38.🔁 How many times does this code print “Well done”?
for (let i = 3; i <= 11; i++) {
console.log("Well done");
} - 39.What does text-align do? (a) makes letters bigger (b) picks the font style (c) colours behind the text (d) centres a heading
- 40.🔠 Which heading shows the BIGGEST text: <h5>, <h2>, <h6> or <h3>? (a) <h5> (b) <h2> (c) <h3> (d) <h6>
Answer key
- 8
- the later one
- log out on shared PCs
- 6
- orange
- to leave notes
- bright green
- easy to read
- False
- 3
- on the browser tab
- color
- True
- index.html
- <tr>
- a web browser
- Try again
- <article>
- https
- #
- 54
- a solid or dotted edge
- orange
- in a new tab
- many pages
- teen
- 3
- <a>
- 36
- child
- changes the page live
- Yes
- 50
- False
- 10
- a class selector
- blue
- 9
- centres a heading
- <h2>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids