← CSS test lesson New set →

CSS Worksheet: Practice Test

HTML and CSS lesson 20: CSS test · Set 624 · 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 hex code is white? (a) #00ffff (b) #ff00ff (c) #ffff00 (d) #ffffff
  2. 2.✍️ How many declarations (property: value pairs) are in this rule?
    .note {
      font-weight: bold;
      width: 300px;
    }
  3. 3.True or false: li is an element selector. (a) True (b) False
  4. 4.What does color do? (a) colours behind the text (b) sets the letter colour (c) makes the text bold (d) centres a heading
  5. 5.💪 How much empty space (px) is before the first box?
    .row {
      display: flex;
      width: 330px;
      justify-content: flex-end;
    }
    Inside are 3 boxes, each 100px wide (no margins).
  6. 6.What does background-color do? (a) centres a heading (b) makes the text bold (c) colours behind the text (d) makes letters bigger
  7. 7.🎨 What does CSS stand for? (a) Colourful Site Styles (b) Cascading Style Sheets (c) Computer Style Sheets (d) Creative Sheet System
  8. 8.📦 In the box model, which part is a solid or dotted edge? (a) padding (b) content (c) border (d) margin
  9. 9.📱 The screen is 375px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 16px;
    }
    @media (min-width: 1024px) {
      p {
        font-size: 24px;
      }
    }
  10. 10.🌈 Which colour is #000000? (a) yellow (b) red (c) cyan (d) black
  11. 11.True or false: the border is the gap round content. (a) True (b) False
  12. 12.True or false: the border is a solid or dotted edge. (a) True (b) False
  13. 13.True or false: HTML checks a quiz answer. (a) False (b) True
  14. 14.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
    .box {
      width: 50px;
      padding: 25px;
      border: 5px solid black;
      margin: 0px;
    }
  15. 15.🎨 Which tag connects an outside CSS file? (a) <img> (b) <css> (c) <a> (d) <link>
  16. 16.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
    .box {
      width: 130px;
      padding: 15px;
      border: 4px solid black;
      margin: 10px;
    }
  17. 17.💪 How wide (px) is each gap between two boxes?
    .row {
      display: flex;
      width: 210px;
      justify-content: space-between;
    }
    Inside are 2 boxes, each 80px wide (no margins).
  18. 18.True or false: img is a class selector. (a) True (b) False
  19. 19.💪 How much empty space (px) is left after the last box?
    .row {
      display: flex;
      width: 290px;
      justify-content: flex-start;
    }
    Inside are 3 boxes, each 80px wide (no margins).
  20. 20.✍️ What value is given to width in this rule?
    h1 {
      padding: 8px;
      width: 300px;
      text-align: center;
    }
    (a) width (b) 300px (c) italic (d) red
  21. 21.🎯 What kind of selector is .note? (a) an element selector (b) an id selector (c) a class selector
  22. 22.📦 In the box model, which part is the text or picture? (a) border (b) margin (c) padding (d) content
  23. 23.⚖️ What colour is the text of this element?
    <p class="box" id="end">Hi</p>
    CSS:
    #end { color: white; }
    #end { color: green; }
    (a) green (b) red (c) blue (d) white
  24. 24.📦 How much space top to bottom (px) does this box take in all, margin included?
    .box {
      height: 110px;
      padding: 25px;
      border: 1px solid black;
      margin: 20px;
    }
  25. 25.✍️ What value is given to font-size in this rule?
    li {
      font-size: 20px;
      padding: 8px;
    }
    (a) center (b) 20px (c) font-size (d) yellow
  26. 26.✍️ Which property is set to yellow in this rule?
    h1 {
      color: red;
      background-color: yellow;
      font-weight: bold;
      text-align: center;
    }
    (a) padding (b) yellow (c) margin (d) background-color
  27. 27.📱 The screen is 320px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 24px;
    }
    @media (min-width: 768px) {
      p {
        font-size: 32px;
      }
    }
  28. 28.🌈 Which colour is rgb(255, 255, 0)? (a) yellow (b) red (c) magenta (d) white
  29. 29.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 100px;
      padding: 30px;
      border: 3px solid black;
      margin: 20px;
    }
  30. 30.True or false: JavaScript adds space around boxes. (a) True (b) False
  31. 31.💪 How much empty space (px) is before the first box?
    .row {
      display: flex;
      width: 320px;
      justify-content: center;
    }
    Inside are 4 boxes, each 60px wide (no margins).
  32. 32.💪 How much empty space (px) is before the first box?
    .row {
      display: flex;
      width: 360px;
      justify-content: center;
    }
    Inside are 3 boxes, each 80px wide (no margins).
  33. 33.🌈 In #b20000 the red part is the hex number b2. What is it as a normal number?
  34. 34.🧩 Which language checks a quiz answer? (a) JavaScript (b) HTML (c) CSS
  35. 35.⚖️ What colour is the text of this element?
    <p class="note" id="main">Hi</p>
    CSS:
    p { color: blue; }
    p { color: red; }
    (a) blue (b) orange (c) red (d) green
  36. 36.🎯 What kind of selector is li? (a) an element selector (b) a class selector (c) an id selector
  37. 37.🖌️ What colour are the letters?
    li {
      background-color: green;
      font-size: 12px;
      text-align: left;
      color: red;
    }
    (a) black (b) green (c) red
  38. 38.📦 In the box model, which part is the gap to other boxes? (a) content (b) border (c) margin (d) padding
  39. 39.🌈 In #000088 the blue part is the hex number 88. What is it as a normal number?
  40. 40.🌈 Which hex code is black? (a) #ffffff (b) #000000 (c) #ff00ff (d) #ffff00

Answer key

  1. #ffffff
  2. 2
  3. True
  4. sets the letter colour
  5. 30
  6. colours behind the text
  7. Cascading Style Sheets
  8. border
  9. 16
  10. black
  11. False
  12. True
  13. False
  14. 110
  15. <link>
  16. 168
  17. 50
  18. False
  19. 50
  20. 300px
  21. a class selector
  22. content
  23. green
  24. 202
  25. 20px
  26. background-color
  27. 24
  28. yellow
  29. 206
  30. False
  31. 40
  32. 60
  33. 178
  34. JavaScript
  35. red
  36. an element selector
  37. red
  38. margin
  39. 136
  40. #000000

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