← CSS test lesson New set →

CSS Worksheet: Practice Test

HTML and CSS lesson 20: CSS test · Set 601 · 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.🌈 In #000021 the blue part is the hex number 21. What is it as a normal number?
  2. 2.📱 max-width: 600px applies when the screen is ___. (a) exactly 1000px (b) 600px or wider (c) 600px or narrower (d) turned off
  3. 3.✍️ In color: blue; which part is the value? (a) ; (b) color (c) : (d) blue
  4. 4.🌈 In #rrggbb, which colour do the first two digits give? (a) green (b) blue (c) black (d) red
  5. 5.✍️ Which sign goes between a property and its value? (a) ; (b) - (c) : (d) =
  6. 6.📱 The screen is 1100px wide. Does the rule inside @media apply?
    p {
      font-size: 16px;
    }
    @media (min-width: 480px) {
      p {
        font-size: 18px;
      }
    }
    (a) Yes (b) No
  7. 7.🎯 Which element does the selector .note style? (a) <h2 class="big"> (b) <li class="red"> (c) <h2 id="note"> (d) <h2 class="note">
  8. 8.🌈 Which colour is rgb(255, 255, 0)? (a) magenta (b) red (c) cyan (d) yellow
  9. 9.🎯 What kind of selector is .note? (a) a class selector (b) an element selector (c) an id selector
  10. 10.🔍 Which is the odd one out? (a) reacts to a button click (b) checks a quiz answer (c) makes a form box (d) counts down a timer
  11. 11.⚖️ What colour is the text of this element?
    <h1 class="note" id="intro">Hi</h1>
    CSS:
    .note { color: black; }
    h1 { color: orange; }
    #intro { color: white; }
    (a) black (b) orange (c) yellow (d) white
  12. 12.💪 How wide (px) is each gap between two boxes?
    .row {
      display: flex;
      width: 460px;
      justify-content: space-between;
    }
    Inside are 3 boxes, each 100px wide (no margins).
  13. 13.🌈 Which colour is rgb(255, 0, 255)? (a) black (b) bright green (c) magenta (d) cyan
  14. 14.📱 The screen is 700px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 24px;
    }
    @media (min-width: 1024px) {
      p {
        font-size: 26px;
      }
    }
  15. 15.🎯 Which CSS selector matches this element?
    <span class="big" id="main">Hello</span>
    (a) #big (b) .big (c) p (d) .red
  16. 16.🌈 Which colour of light is strongest in rgb(150, 67, 63)? (a) green (b) red (c) blue
  17. 17.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 100px;
      padding: 5px;
      border: 5px solid black;
      margin: 10px;
    }
  18. 18.💪 How wide (px) is each gap between two boxes?
    .row {
      display: flex;
      width: 440px;
      justify-content: space-between;
    }
    Inside are 4 boxes, each 80px wide (no margins).
  19. 19.⚖️ What colour is the text of this element?
    <h1 class="red" id="main">Hi</h1>
    CSS:
    .red { color: green; }
    .red { color: black; }
    (a) orange (b) black (c) green (d) red
  20. 20.🖌️ Which CSS property makes the text bold? (a) font-size (b) background-color (c) font-weight (d) color
  21. 21.⚖️ What colour is the text of this element?
    <p class="box" id="main">Hi</p>
    CSS:
    p { color: green; }
    p { color: red; }
    (a) green (b) blue (c) red (d) orange
  22. 22.🎯 Which element does the selector div style? (a) <span> (b) <p class="star"> (c) <div class="star"> (d) <h1 id="main">
  23. 23.Which of these is the border? (a) the gap to other boxes (b) the line round the box (c) space inside the border (d) the gap round content
  24. 24.🌈 In #00b800 the green part is the hex number b8. What is it as a normal number?
  25. 25.🎯 What kind of selector is #logo? (a) an id selector (b) a class selector (c) an element selector
  26. 26.True or false: #main is an id selector. (a) True (b) False
  27. 27.🖌️ What colour is behind the letters?
    h2 {
      text-align: right;
      color: orange;
      font-size: 12px;
      background-color: green;
    }
    (a) blue (b) green (c) orange
  28. 28.⚖️ Which selector is the weakest? (a) an id selector (b) a class selector (c) an element selector
  29. 29.✍️ What value is given to margin in this rule?
    p {
      margin: 10px;
      background-color: yellow;
      text-align: center;
      padding: 8px;
    }
    (a) 10px (b) bold (c) margin (d) 8px
  30. 30.💪 How much empty space (px) is before the first box?
    .row {
      display: flex;
      width: 330px;
      justify-content: flex-end;
    }
    Inside are 4 boxes, each 80px wide (no margins).
  31. 31.True or false: CSS reacts to a button click. (a) False (b) True
  32. 32.Which of these is the content? (a) a solid or dotted edge (b) the line round the box (c) the text or picture (d) space inside the border
  33. 33.True or false: HTML puts a picture on a page. (a) True (b) False
  34. 34.Which of these does JavaScript do? (a) shows a pop-up message (b) sets colours and fonts (c) puts a picture on a page (d) adds space around boxes
  35. 35.🎯 Which CSS selector matches this element?
    <h1 class="big" id="hero">Hello</h1>
    (a) #big (b) .big (c) .hero (d) .red
  36. 36.🎯 Which element does the selector .big style? (a) <span class="red"> (b) <p class="box"> (c) <span class="big"> (d) <span id="big">
  37. 37.🖌️ Which CSS property sets the letter colour? (a) text-align (b) font-weight (c) font-size (d) color
  38. 38.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
    .box {
      width: 140px;
      padding: 15px;
      border: 4px solid black;
      margin: 20px;
    }
  39. 39.📱 Responsive design means a page ___. (a) has no pictures (b) never changes (c) fits every screen (d) is only for laptops
  40. 40.True or false: CSS gives the page structure. (a) True (b) False

Answer key

  1. 33
  2. 600px or narrower
  3. blue
  4. red
  5. :
  6. Yes
  7. <h2 class="note">
  8. yellow
  9. a class selector
  10. makes a form box
  11. white
  12. 80
  13. magenta
  14. 24
  15. .big
  16. red
  17. 140
  18. 40
  19. black
  20. font-weight
  21. red
  22. <div class="star">
  23. the line round the box
  24. 184
  25. an id selector
  26. True
  27. green
  28. an element selector
  29. 10px
  30. 10
  31. False
  32. the text or picture
  33. True
  34. shows a pop-up message
  35. .big
  36. <span class="big">
  37. color
  38. 178
  39. fits every screen
  40. False

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