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.✍️ CSS declarations go inside which brackets? (a) [ ] (b) < > (c) { } (d) ( )
- 2.True or false: in <img>, alt shows if the image fails. (a) True (b) False
-
3.🔁 What number does this code print?
let total = 0;
for (let i = 1; i <= 10; i++) {
total = total + i;
}
console.log(total); - 4.🌐 Which one hosts websites online? (a) a code editor (b) a web browser (c) a web server
-
5.⚡ What does this code print? (Look at the quotes!)
let x = "3";
let y = 7;
console.log(x + y); (a) 37 (b) 10 (c) Error - 6.True or false: a code editor saves our .html files. (a) False (b) True
- 7.🔢 To build and share your first web page, what comes right after “test in a browser”? (a) add CSS styles (b) write the HTML (c) publish it online (d) plan what to show
-
8.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 230px;
padding: 20px;
border: 3px solid black;
margin: 10px;
} - 9.True or false: <input type="number"> lets you tick many. (a) True (b) False
-
10.🖌️ What colour is behind the letters?
h2 {
font-size: 36px;
color: purple;
text-align: left;
background-color: white;
} (a) white (b) purple (c) green - 11.💬 How does an HTML comment start? (a) <!-- (b) // (c) # (d) /*
- 12.🎯 How many elements on a page should have the same id? (a) 5 (b) 2 (c) any number (d) 1
-
13.📋 Does this list show bullets or numbers?
<ul>
<li>Grapes</li>
<li>Orange</li>
<li>Mango</li>
</ul> (a) bullets (b) numbers -
14.🔍 One closing tag is missing. Which one?
<h1>Good morning!
<em>I love mangoes.</em>
<i>My best friend</i> (a) </i> (b) </h2> (c) </em> (d) </h1> - 15.🌍 Which one shows the page to you? (a) the browser (b) the URL (c) HTTPS (d) the server
-
16.💪 How much empty space (px) is before the first box?
.row {
display: flex;
width: 170px;
justify-content: center;
}
Inside are 3 boxes, each 50px wide (no margins). - 17.⚖️ Which selector is the strongest? (a) a class selector (b) an id selector (c) an element selector
-
18.🖌️ How big is the text, in px?
h1 {
font-size: 28px;
background-color: red;
color: white;
text-align: left;
} -
19.🔍 Which line is missing its closing tag?
line 1: <h1>My pets
line 2: <p>Fun facts</p>
line 3: <i>Good morning!</i> (a) line 2 (b) line 1 (c) line 3 - 20.What is <input type="radio"> for? (a) picks a day (b) lets you pick only one (c) hides what you type (d) is for an email address
- 21.True or false: the border is space inside the border. (a) True (b) False
- 22.🏷️ Which is the closing tag for <h3>? (a) <h3> (b) </h3> (c) <\h3> (d) <h3/>
-
23.✍️ How many declarations (property: value pairs) are in this rule?
h1 {
color: red;
font-size: 20px;
margin: 10px;
} - 24.📝 What does <br> do? (a) adds a picture (b) makes text bold (c) makes a list (d) starts a new line
- 25.True or false: <nav> holds a side box of tips. (a) True (b) False
- 26.📊 Which tag gives the table a title? (a) <td> (b) <th> (c) <tr> (d) <caption>
- 27.Which of these is an empty tag? (a) <h1> (b) <li> (c) <meta> (d) <title>
-
28.🖼️ Which picture file does the browser load?
<img src="fort.jpg" alt="An old fort" width="350"> (a) tiger.jpg (b) fort.jpg (c) An old fort (d) kite.png -
29.🖼️ Which picture file does the browser load?
<img src="tiger.jpg" alt="A tiger asleep" width="50"> (a) A tiger asleep (b) map.png (c) tiger.jpg (d) kite.png -
30.✍️ What is the selector in this CSS rule?
h1 {
padding: 8px;
font-style: italic;
color: red;
border: 2px solid;
} (a) h1 (b) italic (c) p (d) padding -
31.🖌️ What colour is behind the letters?
h2 {
font-size: 16px;
color: blue;
text-align: right;
background-color: green;
} (a) orange (b) green (c) blue - 32.🔤 In “HTML”, what does the L stand for? (a) Laptop (b) Line (c) Link (d) Language
- 33.📝 Does <p> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
- 34.📄 Where does <meta charset="utf-8"> go: in the head or in the body? (a) in the head (b) in the body
- 35.📋 Which list shows the steps of a recipe best? (a) <br> (b) <hr> (c) <ul> (d) <ol>
- 36.🎨 What does CSS stand for? (a) Creative Sheet System (b) Cascading Style Sheets (c) Computer Style Sheets (d) Colourful Site Styles
- 37.🏷️ Which is the closing tag for <h1>? (a) </h1> (b) <h1/> (c) <\h1> (d) <h1>
- 38.📄 Which part holds everything you see on the page? (a) the title (b) the doctype (c) the head (d) the body
- 39.True or false: score = score + 1; goes in script.js. (a) False (b) True
- 40.🚀 Which file should this code go in: score = score + 1; (a) style.css (b) script.js (c) index.html
Answer key
- { }
- True
- 55
- a web server
- 37
- True
- publish it online
- 276
- False
- white
- <!--
- 1
- bullets
- </h1>
- the browser
- 10
- an id selector
- 28
- line 1
- lets you pick only one
- False
- </h3>
- 3
- starts a new line
- False
- <caption>
- <meta>
- fort.jpg
- tiger.jpg
- h1
- green
- Language
- has a closing tag
- in the head
- <ol>
- Cascading Style Sheets
- </h1>
- the body
- True
- script.js
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids