← CSS test lesson New set →

CSS Worksheet: Practice Test

HTML and CSS lesson 20: CSS test · Set 631 · 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 CSS property colours behind the text? (a) background-color (b) text-align (c) font-size (d) font-family
  2. 2.What does font-weight do? (a) sets the letter colour (b) colours behind the text (c) makes the text bold (d) makes letters bigger
  3. 3.🎨 What does CSS stand for? (a) Cascading Style Sheets (b) Colourful Site Styles (c) Computer Style Sheets (d) Creative Sheet System
  4. 4.📱 min-width: 800px applies when the screen is ___. (a) exactly 100px (b) 800px or wider (c) 800px or narrower (d) turned off
  5. 5.✍️ CSS declarations go inside which brackets? (a) < > (b) [ ] (c) { } (d) ( )
  6. 6.✍️ Which property is set to 8px in this rule?
    .box {
      font-weight: bold;
      font-size: 20px;
      padding: 8px;
    }
    (a) 8px (b) font-weight (c) border (d) padding
  7. 7.🎨 Which attribute adds CSS inside one tag? (a) alt (b) style (c) href (d) src
  8. 8.✍️ What is the selector in this CSS rule?
    .note {
      color: red;
      border: 2px solid;
      width: 300px;
    }
    (a) color (b) #top (c) .note (d) 2px solid
  9. 9.⚖️ Which selector is the weakest? (a) an id selector (b) a class selector (c) an element selector
  10. 10.What does font-size do? (a) centres a heading (b) picks the font style (c) makes letters bigger (d) sets the letter colour
  11. 11.🌈 Which colour of light is strongest in rgb(219, 99, 27)? (a) red (b) blue (c) green
  12. 12.🖌️ What colour are the letters?
    p {
      background-color: white;
      text-align: center;
      font-size: 20px;
      color: green;
    }
    (a) green (b) orange (c) white
  13. 13.What does color do? (a) makes letters bigger (b) centres a heading (c) makes the text bold (d) sets the letter colour
  14. 14.✍️ Which sign goes between a property and its value? (a) ; (b) - (c) = (d) :
  15. 15.📱 The screen is 414px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 24px;
    }
    @media (max-width: 600px) {
      p {
        font-size: 22px;
      }
    }
  16. 16.🎯 Which element does the selector #intro style? (a) <h1 class="note"> (b) <p class="intro"> (c) <p id="main"> (d) <p id="intro">
  17. 17.🌈 Which colour is #ffffff? (a) red (b) white (c) blue (d) cyan
  18. 18.🎯 Which element does the selector h2 style? (a) <div class="note"> (b) <span id="intro"> (c) <li> (d) <h2 class="note">
  19. 19.🧩 Which language reacts to a button click? (a) HTML (b) CSS (c) JavaScript
  20. 20.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
    .box {
      width: 120px;
      padding: 15px;
      border: 5px solid black;
      margin: 0px;
    }
  21. 21.🔍 Which is the odd one out? (a) adds space around boxes (b) lays out the page (c) shows a pop-up message (d) sets colours and fonts
  22. 22.🎨 One CSS file can style how many pages? (a) only one word (b) only one image (c) many pages (d) no pages
  23. 23.🌈 Which colour is rgb(0, 255, 0)? (a) bright green (b) blue (c) white (d) yellow
  24. 24.⚖️ What colour is the text of this element?
    <h2 class="star" id="logo">Hi</h2>
    CSS:
    h2 { color: white; }
    #logo { color: blue; }
    .star { color: red; }
    (a) blue (b) white (c) black (d) red
  25. 25.🌈 In #rrggbb, which colour do the last two digits give? (a) blue (b) white (c) green (d) red
  26. 26.✍️ In color: blue; which part is the property? (a) blue (b) : (c) color (d) ;
  27. 27.🎯 Which CSS selector matches this element?
    <h2 class="box" id="end">Hello</h2>
    (a) .star (b) li (c) #box (d) .box
  28. 28.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 160px;
      padding: 10px;
      border: 1px solid black;
      margin: 0px;
    }
  29. 29.🌈 Which colour is #000000? (a) yellow (b) white (c) black (d) cyan
  30. 30.🖌️ What colour are the letters?
    p {
      color: green;
      background-color: black;
      font-size: 32px;
      text-align: right;
    }
    (a) black (b) green (c) orange
  31. 31.🌈 In #710000 the red part is the hex number 71. What is it as a normal number?
  32. 32.📱 The screen is 375px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 20px;
    }
    @media (max-width: 600px) {
      p {
        font-size: 18px;
      }
    }
  33. 33.📦 In the box model, which part is space inside the border? (a) content (b) border (c) padding (d) margin
  34. 34.🔍 Which is the odd one out? (a) gives the page structure (b) makes a form box (c) changes the page live (d) makes headings and lists
  35. 35.True or false: .menu is an element selector. (a) False (b) True
  36. 36.Which of these does JavaScript do? (a) changes the text size (b) lays out the page (c) shows a pop-up message (d) rounds box corners
  37. 37.⚖️ What colour is the text of this element?
    <h1 class="box" id="intro">Hi</h1>
    CSS:
    h1 { color: blue; }
    h1 { color: black; }
    (a) red (b) black (c) orange (d) blue
  38. 38.💪 How much empty space (px) is before the first box?
    .row {
      display: flex;
      width: 480px;
      justify-content: center;
    }
    Inside are 4 boxes, each 100px wide (no margins).
  39. 39.📱 The screen is 700px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 24px;
    }
    @media (min-width: 480px) {
      p {
        font-size: 32px;
      }
    }
  40. 40.💪 How wide (px) is each gap between two boxes?
    .row {
      display: flex;
      width: 140px;
      justify-content: space-between;
    }
    Inside are 3 boxes, each 40px wide (no margins).

Answer key

  1. background-color
  2. makes the text bold
  3. Cascading Style Sheets
  4. 800px or wider
  5. { }
  6. padding
  7. style
  8. .note
  9. an element selector
  10. makes letters bigger
  11. red
  12. green
  13. sets the letter colour
  14. :
  15. 22
  16. <p id="intro">
  17. white
  18. <h2 class="note">
  19. JavaScript
  20. 160
  21. shows a pop-up message
  22. many pages
  23. bright green
  24. blue
  25. blue
  26. color
  27. .box
  28. 182
  29. black
  30. green
  31. 113
  32. 18
  33. padding
  34. changes the page live
  35. False
  36. shows a pop-up message
  37. black
  38. 40
  39. 32
  40. 10

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