← CSS test lesson New set →

CSS Worksheet: Practice Test

HTML and CSS lesson 20: CSS test · Set 727 · 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.⚖️ What colour is the text of this element?
    <h1 class="menu" id="main">Hi</h1>
    CSS:
    #main { color: green; }
    #main { color: white; }
    (a) green (b) orange (c) white (d) red
  2. 2.🌈 Which colour is #ffff00? (a) bright green (b) blue (c) yellow (d) red
  3. 3.✍️ In color: blue; which part is the value? (a) blue (b) ; (c) : (d) color
  4. 4.🌈 Which colour is #00ff00? (a) bright green (b) cyan (c) red (d) yellow
  5. 5.🌈 In #rrggbb, which colour do the first two digits give? (a) red (b) green (c) black (d) blue
  6. 6.🌈 Which colour is rgb(255, 0, 255)? (a) red (b) magenta (c) yellow (d) bright green
  7. 7.🖌️ How big is the text, in px?
    h1 {
      font-size: 20px;
      text-align: right;
      background-color: white;
      color: orange;
    }
  8. 8.🖌️ What colour are the letters?
    h1 {
      background-color: green;
      font-size: 40px;
      color: white;
      text-align: right;
    }
    (a) white (b) green (c) blue
  9. 9.🌈 Which colour is #ff00ff? (a) magenta (b) yellow (c) white (d) cyan
  10. 10.🖌️ How big is the text, in px?
    h1 {
      background-color: blue;
      color: green;
      font-size: 40px;
      text-align: right;
    }
  11. 11.⚖️ What colour is the text of this element?
    <h1 class="star" id="hero">Hi</h1>
    CSS:
    h1 { color: red; }
    h1 { color: green; }
    (a) yellow (b) green (c) red (d) white
  12. 12.🌈 In #rrggbb, which colour do the last two digits give? (a) white (b) red (c) green (d) blue
  13. 13.True or false: the content is space inside the border. (a) False (b) True
  14. 14.🌈 Hex digits go 0 to 9, then A to which letter? (a) Z (b) F (c) G (d) J
  15. 15.🎯 What kind of selector is h1? (a) an id selector (b) a class selector (c) an element selector
  16. 16.🔍 Which is the odd one out? (a) changes the text size (b) rounds box corners (c) changes the page live (d) adds space around boxes
  17. 17.⚖️ What colour is the text of this element?
    <h2 class="star" id="intro">Hi</h2>
    CSS:
    #intro { color: black; }
    h2 { color: green; }
    (a) white (b) green (c) blue (d) black
  18. 18.📱 The screen is 1366px wide. Does the rule inside @media apply?
    p {
      font-size: 12px;
    }
    @media (max-width: 480px) {
      p {
        font-size: 8px;
      }
    }
    (a) No (b) Yes
  19. 19.True or false: the content is the gap round content. (a) True (b) False
  20. 20.🖌️ What colour are the letters?
    li {
      color: green;
      font-size: 16px;
      background-color: red;
      text-align: right;
    }
    (a) white (b) green (c) red
  21. 21.✍️ How many declarations (property: value pairs) are in this rule?
    h1 {
      border: 2px solid;
    }
  22. 22.✍️ Which property is set to 20px in this rule?
    h2 {
      font-size: 20px;
      border: 2px solid;
      background-color: yellow;
    }
    (a) text-align (b) 20px (c) font-size (d) background-color
  23. 23.🎨 One CSS file can style how many pages? (a) no pages (b) only one word (c) many pages (d) only one image
  24. 24.🌈 Which hex code is cyan? (a) #00ff00 (b) #00ffff (c) #ff00ff (d) #000000
  25. 25.⚖️ What colour is the text of this element?
    <h2 class="star" id="intro">Hi</h2>
    CSS:
    h2 { color: black; }
    h2 { color: green; }
    (a) white (b) green (c) black (d) purple
  26. 26.🖌️ Which CSS property centres a heading? (a) font-family (b) color (c) text-align (d) font-size
  27. 27.True or false: .card is a class selector. (a) False (b) True
  28. 28.🌈 Which hex code is black? (a) #ffff00 (b) #000000 (c) #ffffff (d) #00ffff
  29. 29.🖌️ What colour are the letters?
    p {
      background-color: green;
      color: white;
      font-size: 16px;
      text-align: center;
    }
    (a) green (b) white (c) blue
  30. 30.✍️ How many declarations (property: value pairs) are in this rule?
    p {
      color: red;
      font-style: italic;
    }
  31. 31.🌈 Which colour is #0000ff? (a) black (b) blue (c) cyan (d) yellow
  32. 32.True or false: the border is the line round the box. (a) False (b) True
  33. 33.True or false: body is an id selector. (a) False (b) True
  34. 34.🌈 Which colour is rgb(0, 255, 255)? (a) cyan (b) red (c) yellow (d) bright green
  35. 35.🎯 Can many elements share the same class? (a) No (b) Yes
  36. 36.🌈 In #00a300 the green part is the hex number a3. What is it as a normal number?
  37. 37.💪 How wide (px) is each gap between two boxes?
    .row {
      display: flex;
      width: 150px;
      justify-content: space-between;
    }
    Inside are 2 boxes, each 40px wide (no margins).
  38. 38.✍️ How many declarations (property: value pairs) are in this rule?
    body {
      background-color: yellow;
      width: 300px;
      font-size: 20px;
      margin: 10px;
    }
  39. 39.🖌️ What colour are the letters?
    h1 {
      background-color: blue;
      text-align: left;
      font-size: 24px;
      color: orange;
    }
    (a) purple (b) blue (c) orange
  40. 40.🎨 A CSS file usually ends with which extension? (a) .js (b) .png (c) .html (d) .css

Answer key

  1. white
  2. yellow
  3. blue
  4. bright green
  5. red
  6. magenta
  7. 20
  8. white
  9. magenta
  10. 40
  11. green
  12. blue
  13. False
  14. F
  15. an element selector
  16. changes the page live
  17. black
  18. No
  19. False
  20. green
  21. 1
  22. font-size
  23. many pages
  24. #00ffff
  25. green
  26. text-align
  27. True
  28. #000000
  29. white
  30. 2
  31. blue
  32. True
  33. False
  34. cyan
  35. Yes
  36. 163
  37. 70
  38. 4
  39. orange
  40. .css

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