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 colour is the text of this element?
<h2 class="note" id="main">Hi</h2>
CSS:
#main { color: blue; }
#main { color: orange; } (a) orange (b) blue (c) white (d) black - 2.🧭 Which semantic tag holds the logo and title? (a) <footer> (b) <article> (c) <header> (d) <nav>
-
3.📝 On how many lines does the browser show this paragraph?
<p>Sky is blue<br>Stars shine</p> - 4.True or false: score = score + 1; goes in script.js. (a) True (b) False
-
5.🔁 How many times does this code print “Hi”?
for (let i = 0; i <= 8; i++) {
console.log("Hi");
} -
6.✍️ How many declarations (property: value pairs) are in this rule?
.box {
background-color: yellow;
margin: 10px;
border: 2px solid;
} -
7.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 190px;
padding: 30px;
border: 2px solid black;
margin: 0px;
} - 8.⚖️ Which selector is the strongest? (a) an element selector (b) an id selector (c) a class selector
- 9.🔢 When you open a web page, which comes first: “DNS finds the server” or “the server sends files”? (a) the server sends files (b) DNS finds the server
- 10.📄 Where does <style> go: in the head or in the body? (a) in the head (b) in the body
-
11.🔗 Which words do you click on?
<a href="contact.html">Play games</a> (a) Play games (b) contact.html (c) href (d) About us - 12.Which of these is an opening tag? (a) </p> (b) </li> (c) <h1> (d) </h1>
-
13.🔁 How many numbers does this code print?
for (let i = 0; i < 10; i = i + 2) {
console.log(i);
} - 14.Which of these goes in the head? (a) <h1> (b) <link rel="stylesheet"> (c) <p> (d) <ul>
- 15.📄 Can HTML on its own make tables? (a) No (b) Yes
-
16.♿ Is this heading order correct (no level skipped)?
<h1> → <h3> → <h3> → <h4> (a) No (b) Yes -
17.⚖️ What colour is the text of this element?
<h1 class="box" id="hero">Hi</h1>
CSS:
h1 { color: green; }
.box { color: red; } (a) black (b) green (c) red (d) blue -
18.⚖️ What colour is the text of this element?
<h1 class="note" id="top">Hi</h1>
CSS:
.note { color: red; }
.note { color: green; } (a) yellow (b) red (c) purple (d) green -
19.📊 How many rows does this table have?
<table>
<tr><td>Litchi</td><td>Litchi</td><td>Jamun</td><td>Grapes</td></tr>
<tr><td>Orange</td><td>Banana</td><td>Guava</td><td>Mango</td></tr>
<tr><td>Jamun</td><td>Orange</td><td>Litchi</td><td>Jamun</td></tr>
</table> -
20.📝 At most, how many of these can be chosen at the same time?
<form>
<input type="checkbox" name="sport"> Cricket
<input type="checkbox" name="sport"> Hockey
<input type="checkbox" name="sport"> Football
</form> - 21.🚀 Which file should this code go in: .box { padding: 8px; } (a) style.css (b) script.js (c) index.html
-
22.🔁 What number does this code print?
let total = 0;
for (let i = 1; i <= 5; i++) {
total = total + 9;
}
console.log(total); -
23.🌍 What is the path in this URL?
https://www.example.com/about.html (a) www.example.com (b) https (c) /about.html (d) /maths/tables.html - 24.Which colour pair is easy to read? (a) red on green (b) yellow on black (c) yellow on white (d) blue on purple
- 25.🧭 How many <main> parts should a page have? (a) three (b) none (c) one (d) ten
- 26.🖼️ Why do we add alt text to an image? (a) to load it faster (b) to describe the image (c) to make it bigger (d) to colour it
- 27.🌈 Which colour is rgb(0, 0, 255)? (a) cyan (b) magenta (c) blue (d) black
- 28.Which of these is true of a code editor? (a) has an address bar (b) answers page requests (c) colours code to help us (d) hosts websites online
-
29.🎯 Which CSS selector matches this element?
<li class="menu" id="top">Hello</li> (a) #menu (b) .top (c) div (d) #top - 30.Which of these goes in the head? (a) <ul> (b) <meta charset="utf-8"> (c) <p> (d) <table>
- 31.💬 How does an HTML comment start? (a) /* (b) # (c) <!-- (d) //
- 32.Which colour pair is easy to read? (a) blue on purple (b) light grey on white (c) red on green (d) black on white
- 33.📋 Which list suits a shopping list in any order? (a) <ol> (b) <br> (c) <hr> (d) <ul>
-
34.💬 How many paragraphs show on the page?
<!-- <p>Hello, world!</p> -->
<!-- <p>My best friend</p> -->
<p>My pets</p>
<p>I love mangoes.</p> -
35.📱 The screen is 414px wide. Does the rule inside @media apply?
p {
font-size: 16px;
}
@media (min-width: 600px) {
p {
font-size: 22px;
}
} (a) No (b) Yes - 36.🖼️ Which attribute of <img> names the picture file? (a) alt (b) src (c) width (d) height
- 37.True or false: #end is a class selector. (a) False (b) True
-
38.🖼️ Which picture file does the browser load?
<img src="tiger.jpg" alt="A tiger asleep" width="100"> (a) A tiger asleep (b) kite.png (c) map.png (d) tiger.jpg -
39.💬 Which text will NOT show on the page?
<p>Good morning!</p>
<p>I love mangoes.</p>
<p>Fun facts</p>
<!-- <p>Hello, world!</p> --> (a) Good morning! (b) I love mangoes. (c) Fun facts (d) Hello, world! -
40.⚡ What does this code print? (Look at the quotes!)
let x = "3";
let y = 3;
console.log(x + y); (a) Error (b) 6 (c) 33
Answer key
- orange
- <header>
- 2
- True
- 9
- 3
- 254
- an id selector
- DNS finds the server
- in the head
- Play games
- <h1>
- 5
- <link rel="stylesheet">
- Yes
- No
- red
- green
- 3
- 3
- style.css
- 45
- /about.html
- yellow on black
- one
- to describe the image
- blue
- colours code to help us
- #top
- <meta charset="utf-8">
- <!--
- black on white
- <ul>
- 2
- No
- src
- False
- tiger.jpg
- Hello, world!
- 33
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids