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 language rounds box corners? (a) JavaScript (b) CSS (c) HTML
- 2.💪 Which justify-content value equal gaps, none at ends? (a) space-between (b) flex-end (c) flex-start (d) center
- 3.🎯 Which element does the selector #main style? (a) <div class="note"> (b) <li id="main"> (c) <li id="logo"> (d) <li class="main">
- 4.True or false: the content is a solid or dotted edge. (a) False (b) True
- 5.📱 Responsive design means a page ___. (a) is only for laptops (b) never changes (c) has no pictures (d) fits every screen
- 6.🌈 In #001800 the green part is the hex number 18. What is it as a normal number?
-
7.🖌️ How big is the text, in px?
li {
text-align: left;
font-size: 24px;
background-color: orange;
color: green;
} - 8.🌈 In #260000 the red part is the hex number 26. What is it as a normal number?
- 9.🎯 Which element does the selector #intro style? (a) <span id="main"> (b) <span class="intro"> (c) <span id="intro"> (d) <p class="menu">
- 10.🌈 Which colour of light is strongest in rgb(15, 132, 255)? (a) red (b) green (c) blue
- 11.💪 Which flexbox property turns on flexbox? (a) align-items (b) justify-content (c) flex-direction (d) display: flex
- 12.🎯 What kind of selector is #logo? (a) an element selector (b) a class selector (c) an id selector
- 13.True or false: .note is a class selector. (a) True (b) False
-
14.⚖️ What colour is the text of this element?
<p class="box" id="top">Hi</p>
CSS:
p { color: black; }
.box { color: blue; } (a) black (b) green (c) blue (d) purple - 15.🎨 Which attribute adds CSS inside one tag? (a) alt (b) src (c) style (d) href
- 16.🌈 Which colour is rgb(0, 0, 255)? (a) bright green (b) red (c) cyan (d) blue
- 17.What does justify-content: flex-end do? (a) packs boxes at the end (b) puts boxes in the middle (c) packs boxes at the start (d) equal gaps, none at ends
- 18.📦 In the box model, which part is space inside the border? (a) margin (b) border (c) content (d) padding
-
19.🎯 Which CSS selector matches this element?
<h1 class="box" id="main">Hello</h1> (a) .box (b) #box (c) .star (d) #logo -
20.✍️ Which property is set to 8px in this rule?
.note {
font-style: italic;
padding: 8px;
font-size: 20px;
} (a) padding (b) border (c) 8px (d) font-weight -
21.⚖️ What colour is the text of this element?
<h1 class="box" id="logo">Hi</h1>
CSS:
h1 { color: orange; }
.box { color: purple; } (a) green (b) orange (c) purple (d) blue - 22.✍️ In color: blue; which part is the value? (a) color (b) : (c) blue (d) ;
- 23.🌈 In #002d00 the green part is the hex number 2d. What is it as a normal number?
-
24.⚖️ What colour is the text of this element?
<p class="box" id="intro">Hi</p>
CSS:
#intro { color: orange; }
.box { color: red; } (a) black (b) orange (c) red (d) white -
25.💪 How much empty space (px) is before the first box?
.row {
display: flex;
width: 260px;
justify-content: center;
}
Inside are 3 boxes, each 60px wide (no margins). -
26.🖌️ How big is the text, in px?
li {
font-size: 12px;
background-color: orange;
text-align: right;
color: red;
} -
27.⚖️ What colour is the text of this element?
<h1 class="note" id="hero">Hi</h1>
CSS:
#hero { color: blue; }
h1 { color: orange; } (a) green (b) purple (c) blue (d) orange - 28.🎯 Which element does the selector div style? (a) <h1 id="top"> (b) <div class="note"> (c) <span> (d) <p class="note">
-
29.🖌️ What colour are the letters?
h1 {
font-size: 20px;
color: blue;
background-color: orange;
text-align: right;
} (a) green (b) orange (c) blue - 30.⚖️ Which selector is the strongest? (a) a class selector (b) an element selector (c) an id selector
- 31.🎯 Which sign starts an id selector? (a) . (b) @ (c) & (d) #
- 32.💪 Which flexbox property picks row or column? (a) justify-content (b) flex-direction (c) align-items (d) display: flex
- 33.💪 Which justify-content value packs boxes at the end? (a) center (b) flex-end (c) flex-start (d) space-between
- 34.🎯 How many elements on a page should have the same id? (a) any number (b) 1 (c) 2 (d) 5
- 35.🎯 Can many elements share the same class? (a) No (b) Yes
- 36.🌈 In #000027 the blue part is the hex number 27. What is it as a normal number?
- 37.True or false: margin is the gap round content. (a) True (b) False
- 38.True or false: .big is a class selector. (a) False (b) True
- 39.✍️ In color: blue; which part is the property? (a) ; (b) color (c) : (d) blue
-
40.🖌️ What colour is behind the letters?
h2 {
background-color: yellow;
text-align: right;
color: orange;
font-size: 40px;
} (a) orange (b) white (c) yellow
Answer key
- CSS
- space-between
- <li id="main">
- False
- fits every screen
- 24
- 24
- 38
- <span id="intro">
- blue
- display: flex
- an id selector
- True
- blue
- style
- blue
- packs boxes at the end
- padding
- .box
- padding
- purple
- blue
- 45
- orange
- 40
- 12
- blue
- <div class="note">
- blue
- an id selector
- #
- flex-direction
- flex-end
- 1
- Yes
- 39
- False
- True
- color
- yellow
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids