CSS Worksheet: Practice Test
Code tip (Rule, then maths): Find the topic: syntax, selectors, properties, colours, box model, cascade, flexbox or media queries. Decide which rule or property applies to the element. For sizes, write the sum down: both sides for the box model, free space for flexbox.
NameDateTime takenScore ___ / 40
- 1.Which of these does HTML do? (a) changes the text size (b) reacts to a button click (c) makes headings and lists (d) checks a quiz answer
-
2.🎯 Which CSS selector matches this element?
<h1 class="note" id="hero">Hello</h1> (a) .hero (b) h2 (c) #hero (d) .big - 3.🔍 Which is the odd one out? (a) makes a form box (b) adds space around boxes (c) sets colours and fonts (d) lays out the page
- 4.🔍 Which is the odd one out? (a) shows a pop-up message (b) counts down a timer (c) sets colours and fonts (d) changes the page live
- 5.🌈 Which colour is #00ffff? (a) white (b) cyan (c) blue (d) magenta
- 6.⚖️ Which selector is the weakest? (a) a class selector (b) an id selector (c) an element selector
- 7.💪 Which justify-content value packs boxes at the end? (a) flex-start (b) space-between (c) flex-end (d) center
- 8.✍️ In color: blue; which part is the value? (a) color (b) ; (c) blue (d) :
-
9.💪 How much empty space (px) is left after the last box?
.row {
display: flex;
width: 360px;
justify-content: flex-start;
}
Inside are 3 boxes, each 100px wide (no margins). -
10.💪 How much empty space (px) is left after the last box?
.row {
display: flex;
width: 120px;
justify-content: flex-start;
}
Inside are 2 boxes, each 50px wide (no margins). -
11.📱 The screen is 320px wide. Does the rule inside @media apply?
p {
font-size: 12px;
}
@media (max-width: 768px) {
p {
font-size: 10px;
}
} (a) No (b) Yes -
12.🎯 Which CSS selector matches this element?
<h2 class="star" id="main">Hello</h2> (a) #logo (b) .menu (c) li (d) h2 - 13.✍️ How does a CSS comment start? (a) // (b) # (c) <!-- (d) /*
-
14.🎯 Which CSS selector matches this element?
<h2 class="menu" id="intro">Hello</h2> (a) #menu (b) li (c) .note (d) #intro -
15.🖌️ What colour are the letters?
h1 {
background-color: green;
font-size: 28px;
color: orange;
text-align: center;
} (a) black (b) orange (c) green -
16.⚖️ What colour is the text of this element?
<h1 class="note" id="intro">Hi</h1>
CSS:
h1 { color: blue; }
h1 { color: green; } (a) blue (b) green (c) black (d) orange -
17.📱 The screen is 1366px wide. What font-size (px) does the paragraph get?
p {
font-size: 24px;
}
@media (min-width: 768px) {
p {
font-size: 32px;
}
} -
18.🖌️ How big is the text, in px?
h2 {
color: red;
background-color: yellow;
text-align: right;
font-size: 32px;
} -
19.📱 The screen is 414px wide. Does the rule inside @media apply?
p {
font-size: 24px;
}
@media (min-width: 1024px) {
p {
font-size: 32px;
}
} (a) Yes (b) No - 20.🌈 What is the biggest number one colour can have in rgb()? (a) 255 (b) 1000 (c) 100 (d) 99
- 21.🖌️ Which CSS property picks the font style? (a) font-family (b) font-size (c) background-color (d) color
- 22.Which of these does JavaScript do? (a) sets colours and fonts (b) gives the page structure (c) makes headings and lists (d) shows a pop-up message
- 23.📦 In the box model, which part is the line round the box? (a) content (b) padding (c) margin (d) border
-
24.📱 The screen is 320px wide. What font-size (px) does the paragraph get?
p {
font-size: 20px;
}
@media (max-width: 768px) {
p {
font-size: 18px;
}
} - 25.🖌️ Which CSS property colours behind the text? (a) background-color (b) font-weight (c) color (d) text-align
-
26.📦 How much space across (px) does this box take in all, margin included?
.box {
width: 110px;
padding: 30px;
border: 5px solid black;
margin: 5px;
} - 27.🖌️ Which CSS property makes the text bold? (a) font-family (b) font-size (c) font-weight (d) text-align
- 28.📱 Responsive design means a page ___. (a) never changes (b) fits every screen (c) is only for laptops (d) has no pictures
-
29.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
.box {
width: 270px;
padding: 20px;
border: 4px solid black;
margin: 0px;
} - 30.🎯 Which element does the selector .box style? (a) <h1 class="menu"> (b) <p class="star"> (c) <p id="box"> (d) <p class="box">
- 31.📱 min-width: 800px applies when the screen is ___. (a) 800px or wider (b) exactly 100px (c) turned off (d) 800px or narrower
-
32.🎯 Which CSS selector matches this element?
<span class="big" id="intro">Hello</span> (a) .red (b) .intro (c) #intro (d) #big - 33.🌈 Which colour is #00ff00? (a) red (b) bright green (c) magenta (d) cyan
-
34.📱 The screen is 320px wide. Does the rule inside @media apply?
p {
font-size: 24px;
}
@media (min-width: 480px) {
p {
font-size: 28px;
}
} (a) No (b) Yes - 35.🎨 What does CSS stand for? (a) Colourful Site Styles (b) Computer Style Sheets (c) Creative Sheet System (d) Cascading Style Sheets
-
36.💪 How much empty space (px) is before the first box?
.row {
display: flex;
width: 120px;
justify-content: center;
}
Inside are 2 boxes, each 40px wide (no margins). -
37.⚖️ What colour is the text of this element?
<p class="red" id="logo">Hi</p>
CSS:
p { color: white; }
p { color: red; } (a) blue (b) red (c) purple (d) white -
38.⚖️ What colour is the text of this element?
<h1 class="red" id="main">Hi</h1>
CSS:
#main { color: black; }
.red { color: blue; }
h1 { color: red; } (a) blue (b) orange (c) black (d) red - 39.🎨 One CSS file can style how many pages? (a) no pages (b) only one image (c) many pages (d) only one word
-
40.🖌️ What colour is behind the letters?
p {
background-color: blue;
text-align: center;
font-size: 12px;
color: yellow;
} (a) purple (b) yellow (c) blue
Answer key
- makes headings and lists
- #hero
- makes a form box
- sets colours and fonts
- cyan
- an element selector
- flex-end
- blue
- 60
- 20
- Yes
- h2
- /*
- #intro
- orange
- green
- 32
- 32
- No
- 255
- font-family
- shows a pop-up message
- border
- 18
- background-color
- 190
- font-weight
- fits every screen
- 318
- <p class="box">
- 800px or wider
- #intro
- bright green
- No
- Cascading Style Sheets
- 20
- red
- black
- many pages
- blue
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids