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 coins = 15;
coins = coins + 9;
coins = coins - 12;
console.log(coins); - 2.True or false: the browser is the page’s address. (a) True (b) False
- 3.🖼️ Does <img> need a closing tag? (a) No (b) Yes
-
4.📊 How many cells are in each row?
<table>
<tr><td>Mango</td><td>Mango</td><td>Grapes</td><td>Guava</td></tr>
<tr><td>Guava</td><td>Guava</td><td>Orange</td><td>Banana</td></tr>
</table> -
5.✍️ What is the selector in this CSS rule?
.box {
background-color: yellow;
font-style: italic;
} (a) italic (b) h2 (c) background-color (d) .box -
6.⚡ What number does this code print?
let a = 7;
let b = 9;
console.log(a + b); - 7.🔍 Which is the odd one out? (a) is where we type code (b) answers page requests (c) colours code to help us (d) saves our .html files
- 8.📄 Where does <link rel="stylesheet"> go: in the head or in the body? (a) in the head (b) in the body
- 9.True or false: in <img>, height shows if the image fails. (a) True (b) False
- 10.🔁 When does the else part run? (a) when if is false (b) when if is true (c) always (d) never
- 11.🔠 Which heading shows the SMALLEST text: <h6>, <h1>, <h2> or <h4>? (a) <h2> (b) <h1> (c) <h4> (d) <h6>
-
12.🔍 Which line is missing its closing tag?
line 1: <em>My pets
line 2: <h1>Cricket is fun.</h1>
line 3: <strong>Hello, world!</strong> (a) line 2 (b) line 3 (c) line 1 - 13.🖼️ Which attribute of <img> names the picture file? (a) alt (b) width (c) src (d) height
-
14.💬 Which text will NOT show on the page?
<!-- <p>I love mangoes.</p> -->
<p>My best friend</p>
<p>Rain today</p> (a) My best friend (b) Rain today (c) I love mangoes. - 15.⚡ Which JavaScript word repeats code? (a) if (b) let (c) for (d) alert()
-
16.🖌️ What colour is behind the letters?
h2 {
color: orange;
background-color: yellow;
font-size: 40px;
text-align: right;
} (a) orange (b) green (c) yellow - 17.True or false: HTML on its own can pick a random number. (a) False (b) True
- 18.🎯 What kind of selector is #main? (a) an id selector (b) an element selector (c) a class selector
-
19.🎯 Which CSS selector matches this element?
<p class="note" id="main">Hello</p> (a) .big (b) .note (c) h1 (d) .main -
20.✍️ What value is given to padding in this rule?
li {
text-align: center;
padding: 8px;
font-size: 20px;
} (a) bold (b) padding (c) 2px solid (d) 8px -
21.🔁 What does this code print?
let age = 2;
if (age > 15) {
console.log("teen");
} else {
console.log("child");
} (a) teen (b) child - 22.📦 In the box model, which part is the line round the box? (a) border (b) padding (c) margin (d) content
- 23.♿ Does this help everyone, or make the page harder to use: tiny grey text? (a) helps everyone (b) makes it harder
-
24.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 70px;
padding: 15px;
border: 3px solid black;
margin: 0px;
} -
25.🔠 How many headings are in this code?
<h1>My pets</h1>
<p>Good morning!</p>
<p>Our school trip</p>
<h4>Fun facts</h4>
<p>My best friend</p> - 26.🎯 What kind of selector is .star? (a) an element selector (b) a class selector (c) an id selector
-
27.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="bus.jpg" alt="Our school bus" width="150"> (a) Our school bus (b) An old fort (c) bus.jpg (d) width - 28.Which of these is the border? (a) space outside the border (b) the gap to other boxes (c) a solid or dotted edge (d) space inside the border
-
29.🖼️ How many pixels wide is the picture drawn?
<img src="map.png" alt="Map of India" width="250"> - 30.📝 What does <hr> draw? (a) a picture (b) a link (c) a table (d) a line across the page
- 31.Which of these goes in the head? (a) <h1> (b) <ul> (c) <img> (d) <title>
-
32.🔒 Is the connection to this address scrambled (encrypted)?
http://www.example.net/index.html (a) No (b) Yes - 33.🔢 To build and share your first web page, which comes first: “add CSS styles” or “write the HTML”? (a) add CSS styles (b) write the HTML
- 34.🔗 Which code links to about.html? (a) <a src="about.html"> (b) <a alt="about.html"> (c) <a href="about.html"> (d) <link about.html>
- 35.🔢 To build and share your first web page, which comes first: “publish it online” or “test in a browser”? (a) test in a browser (b) publish it online
- 36.True or false: “use big enough text” makes the page harder to use. (a) True (b) False
- 37.🔠 Which heading shows the BIGGEST text: <h4>, <h3>, <h6> or <h5>? (a) <h3> (b) <h6> (c) <h5> (d) <h4>
- 38.🌈 In #rrggbb, which colour do the last two digits give? (a) red (b) blue (c) green (d) white
- 39.🏷️ Is </body> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
- 40.True or false: <hr> has a closing tag. (a) False (b) True
Answer key
- 12
- False
- No
- 4
- .box
- 16
- answers page requests
- in the head
- False
- when if is false
- <h6>
- line 1
- src
- I love mangoes.
- for
- yellow
- False
- an id selector
- .note
- 8px
- child
- border
- makes it harder
- 106
- 2
- a class selector
- Our school bus
- a solid or dotted edge
- 250
- a line across the page
- <title>
- No
- write the HTML
- <a href="about.html">
- test in a browser
- False
- <h3>
- blue
- a closing tag
- False
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids