← CSS test lesson New set →

CSS Worksheet: Practice Test

HTML and CSS lesson 20: CSS test · Set 229 · 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 language lays out the page? (a) JavaScript (b) CSS (c) HTML
  2. 2.True or false: margin is space outside the border. (a) True (b) False
  3. 3.✍️ How many declarations (property: value pairs) are in this rule?
    #top {
      padding: 8px;
    }
  4. 4.What does text-align do? (a) makes the text bold (b) centres a heading (c) makes letters bigger (d) colours behind the text
  5. 5.💪 Which justify-content value packs boxes at the end? (a) flex-start (b) center (c) space-between (d) flex-end
  6. 6.📱 The screen is 320px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 12px;
    }
    @media (min-width: 600px) {
      p {
        font-size: 18px;
      }
    }
  7. 7.🌈 Which colour is rgb(0, 0, 0)? (a) magenta (b) black (c) yellow (d) red
  8. 8.📱 The screen is 320px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 16px;
    }
    @media (min-width: 768px) {
      p {
        font-size: 24px;
      }
    }
  9. 9.✍️ Which sign ends each CSS declaration? (a) , (b) . (c) ; (d) :
  10. 10.What does justify-content: flex-start do? (a) packs boxes at the end (b) equal gaps, none at ends (c) puts boxes in the middle (d) packs boxes at the start
  11. 11.📱 The screen is 375px wide. Does the rule inside @media apply?
    p {
      font-size: 12px;
    }
    @media (max-width: 600px) {
      p {
        font-size: 10px;
      }
    }
    (a) No (b) Yes
  12. 12.True or false: padding is a solid or dotted edge. (a) False (b) True
  13. 13.🎯 Which CSS selector matches this element?
    <li class="menu" id="intro">Hello</li>
    (a) div (b) #menu (c) #intro (d) .note
  14. 14.True or false: JavaScript puts a picture on a page. (a) False (b) True
  15. 15.🧩 Which language adds space around boxes? (a) HTML (b) JavaScript (c) CSS
  16. 16.📱 The screen is 375px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 16px;
    }
    @media (max-width: 1024px) {
      p {
        font-size: 10px;
      }
    }
  17. 17.⚖️ What colour is the text of this element?
    <h2 class="menu" id="end">Hi</h2>
    CSS:
    #end { color: blue; }
    h2 { color: yellow; }
    (a) black (b) orange (c) yellow (d) blue
  18. 18.🎨 Which tag holds CSS inside the head? (a) <script> (b) <body> (c) <style> (d) <css>
  19. 19.🎯 Which CSS selector matches this element?
    <span class="big" id="end">Hello</span>
    (a) p (b) .end (c) .big (d) #big
  20. 20.⚖️ Which selector is the weakest? (a) a class selector (b) an id selector (c) an element selector
  21. 21.✍️ Which property is set to yellow in this rule?
    .note {
      background-color: yellow;
      text-align: center;
      font-weight: bold;
    }
    (a) background-color (b) margin (c) padding (d) yellow
  22. 22.Which of these is padding? (a) the gap round content (b) space outside the border (c) the line round the box (d) a solid or dotted edge
  23. 23.📱 The screen is 540px wide. Does the rule inside @media apply?
    p {
      font-size: 16px;
    }
    @media (max-width: 480px) {
      p {
        font-size: 12px;
      }
    }
    (a) No (b) Yes
  24. 24.🖌️ Which CSS property colours behind the text? (a) font-family (b) text-align (c) background-color (d) font-size
  25. 25.🔍 Which is the odd one out? (a) gives the page structure (b) makes headings and lists (c) adds space around boxes (d) makes a link
  26. 26.🎨 A CSS file usually ends with which extension? (a) .png (b) .js (c) .css (d) .html
  27. 27.🖌️ Which CSS property makes letters bigger? (a) font-size (b) text-align (c) background-color (d) color
  28. 28.True or false: .note is a class selector. (a) False (b) True
  29. 29.🖌️ Which CSS property sets the letter colour? (a) color (b) font-size (c) font-family (d) background-color
  30. 30.✍️ Which sign goes between a property and its value? (a) = (b) : (c) ; (d) -
  31. 31.⚖️ What colour is the text of this element?
    <h2 class="menu" id="logo">Hi</h2>
    CSS:
    #logo { color: black; }
    #logo { color: orange; }
    (a) red (b) orange (c) yellow (d) black
  32. 32.💪 Which justify-content value packs boxes at the start? (a) flex-start (b) space-between (c) flex-end (d) center
  33. 33.✍️ How many declarations (property: value pairs) are in this rule?
    #top {
      font-weight: bold;
      background-color: yellow;
      font-style: italic;
      font-size: 20px;
    }
  34. 34.📱 The screen is 1100px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 20px;
    }
    @media (min-width: 480px) {
      p {
        font-size: 22px;
      }
    }
  35. 35.🌈 In #rrggbb, which colour do the last two digits give? (a) red (b) white (c) green (d) blue
  36. 36.🖌️ How big is the text, in px?
    p {
      background-color: red;
      font-size: 16px;
      text-align: center;
      color: yellow;
    }
  37. 37.🔍 Which is the odd one out? (a) makes a form box (b) rounds box corners (c) gives the page structure (d) puts a picture on a page
  38. 38.🎨 What does CSS stand for? (a) Cascading Style Sheets (b) Computer Style Sheets (c) Colourful Site Styles (d) Creative Sheet System
  39. 39.🎯 Which CSS selector matches this element?
    <li class="menu" id="main">Hello</li>
    (a) div (b) #logo (c) #menu (d) #main
  40. 40.🎯 Which CSS selector matches this element?
    <h2 class="note" id="intro">Hello</h2>
    (a) .big (b) #intro (c) li (d) .intro

Answer key

  1. CSS
  2. True
  3. 1
  4. centres a heading
  5. flex-end
  6. 12
  7. black
  8. 16
  9. ;
  10. packs boxes at the start
  11. Yes
  12. False
  13. #intro
  14. False
  15. CSS
  16. 10
  17. blue
  18. <style>
  19. .big
  20. an element selector
  21. background-color
  22. the gap round content
  23. No
  24. background-color
  25. adds space around boxes
  26. .css
  27. font-size
  28. True
  29. color
  30. :
  31. orange
  32. flex-start
  33. 4
  34. 22
  35. blue
  36. 16
  37. rounds box corners
  38. Cascading Style Sheets
  39. #main
  40. #intro

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