← CSS test lesson New set →

CSS Worksheet: Practice Test

HTML and CSS lesson 20: CSS test · Set 637 · 40 questions
TalentJR

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. 1.🔍 Which is the odd one out? (a) changes the text size (b) makes a form box (c) gives the page structure (d) makes headings and lists
  2. 2.✍️ In color: blue; which part is the value? (a) ; (b) color (c) : (d) blue
  3. 3.💪 Which justify-content value packs boxes at the end? (a) flex-start (b) space-between (c) flex-end (d) center
  4. 4.✍️ How many declarations (property: value pairs) are in this rule?
    .box {
      background-color: yellow;
      color: red;
      margin: 10px;
      font-weight: bold;
    }
  5. 5.📱 The screen is 820px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 20px;
    }
    @media (min-width: 1024px) {
      p {
        font-size: 22px;
      }
    }
  6. 6.✍️ How many declarations (property: value pairs) are in this rule?
    .note {
      text-align: center;
      font-weight: bold;
      color: red;
    }
  7. 7.🎯 Which CSS selector matches this element?
    <li class="menu" id="intro">Hello</li>
    (a) div (b) #menu (c) li (d) .note
  8. 8.🎯 Which sign starts a class selector? (a) # (b) . (c) & (d) @
  9. 9.🧩 Which language makes a form box? (a) JavaScript (b) CSS (c) HTML
  10. 10.🎨 What does CSS stand for? (a) Cascading Style Sheets (b) Colourful Site Styles (c) Creative Sheet System (d) Computer Style Sheets
  11. 11.✍️ What value is given to font-size in this rule?
    body {
      font-size: 20px;
      margin: 10px;
      background-color: yellow;
      border: 2px solid;
    }
    (a) yellow (b) center (c) 20px (d) font-size
  12. 12.📱 min-width: 800px applies when the screen is ___. (a) exactly 100px (b) 800px or wider (c) 800px or narrower (d) turned off
  13. 13.🌈 Which colour is #ffffff? (a) blue (b) yellow (c) white (d) magenta
  14. 14.📱 max-width: 600px applies when the screen is ___. (a) turned off (b) 600px or narrower (c) exactly 1000px (d) 600px or wider
  15. 15.💪 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).
  16. 16.⚖️ What colour is the text of this element?
    <h2 class="box" id="intro">Hi</h2>
    CSS:
    h2 { color: green; }
    h2 { color: blue; }
    (a) red (b) orange (c) green (d) blue
  17. 17.⚖️ What colour is the text of this element?
    <p class="note" id="end">Hi</p>
    CSS:
    p { color: orange; }
    p { color: green; }
    (a) orange (b) red (c) green (d) purple
  18. 18.⚖️ What colour is the text of this element?
    <p class="menu" id="logo">Hi</p>
    CSS:
    #logo { color: red; }
    .menu { color: blue; }
    (a) white (b) blue (c) green (d) red
  19. 19.True or false: #top is an id selector. (a) True (b) False
  20. 20.🌈 Which colour is rgb(255, 255, 255)? (a) cyan (b) white (c) black (d) magenta
  21. 21.True or false: the content is the gap round content. (a) True (b) False
  22. 22.📦 In the box model, which part is a solid or dotted edge? (a) margin (b) content (c) padding (d) border
  23. 23.📱 The screen is 540px wide. Does the rule inside @media apply?
    p {
      font-size: 20px;
    }
    @media (min-width: 600px) {
      p {
        font-size: 22px;
      }
    }
    (a) Yes (b) No
  24. 24.🧩 Which language makes headings and lists? (a) CSS (b) HTML (c) JavaScript
  25. 25.🖌️ What colour is behind the letters?
    p {
      text-align: right;
      color: purple;
      background-color: white;
      font-size: 28px;
    }
    (a) red (b) white (c) purple
  26. 26.⚖️ What colour is the text of this element?
    <h2 class="star" id="intro">Hi</h2>
    CSS:
    h2 { color: black; }
    h2 { color: blue; }
    (a) red (b) orange (c) blue (d) black
  27. 27.What does text-align do? (a) makes letters bigger (b) makes the text bold (c) sets the letter colour (d) centres a heading
  28. 28.🔍 Which is the odd one out? (a) gives the page structure (b) makes headings and lists (c) makes a link (d) changes the page live
  29. 29.⚖️ What colour is the text of this element?
    <h1 class="box" id="main">Hi</h1>
    CSS:
    h1 { color: orange; }
    #main { color: black; }
    (a) black (b) green (c) orange (d) blue
  30. 30.Which of these is padding? (a) a solid or dotted edge (b) space outside the border (c) the text or picture (d) space inside the border
  31. 31.✍️ How many declarations (property: value pairs) are in this rule?
    .note {
      text-align: center;
    }
  32. 32.Which of these is margin? (a) the line round the box (b) a solid or dotted edge (c) the text or picture (d) space outside the border
  33. 33.🎯 Which element does the selector .big style? (a) <h2 id="big"> (b) <h2 class="red"> (c) <li class="box"> (d) <h2 class="big">
  34. 34.True or false: margin is the gap to other boxes. (a) True (b) False
  35. 35.📱 The screen is 320px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 24px;
    }
    @media (min-width: 600px) {
      p {
        font-size: 30px;
      }
    }
  36. 36.💪 Which justify-content value puts boxes in the middle? (a) center (b) space-between (c) flex-start (d) flex-end
  37. 37.📱 The screen is 320px wide. Does the rule inside @media apply?
    p {
      font-size: 24px;
    }
    @media (max-width: 1024px) {
      p {
        font-size: 22px;
      }
    }
    (a) No (b) Yes
  38. 38.✍️ In color: blue; which part is the property? (a) ; (b) : (c) color (d) blue
  39. 39.🎯 What kind of selector is .menu? (a) a class selector (b) an element selector (c) an id selector
  40. 40.🎯 What kind of selector is h1? (a) a class selector (b) an id selector (c) an element selector

Answer key

  1. changes the text size
  2. blue
  3. flex-end
  4. 4
  5. 20
  6. 3
  7. li
  8. .
  9. HTML
  10. Cascading Style Sheets
  11. 20px
  12. 800px or wider
  13. white
  14. 600px or narrower
  15. 20
  16. blue
  17. green
  18. red
  19. True
  20. white
  21. False
  22. border
  23. No
  24. HTML
  25. white
  26. blue
  27. centres a heading
  28. changes the page live
  29. black
  30. space inside the border
  31. 1
  32. space outside the border
  33. <h2 class="big">
  34. True
  35. 24
  36. center
  37. Yes
  38. color
  39. a class selector
  40. an element selector

Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids