← CSS test lesson New set →

CSS Worksheet: Practice Test

HTML and CSS lesson 20: CSS test · Set 409 · 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 colour of light is strongest in rgb(101, 210, 62)? (a) blue (b) red (c) green
  2. 2.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 230px;
      padding: 20px;
      border: 5px solid black;
      margin: 20px;
    }
  3. 3.⚖️ Two rules with the same selector set a colour. Which one wins? (a) the shorter one (b) neither (c) the first one (d) the later one
  4. 4.⚖️ What colour is the text of this element?
    <p class="big" id="top">Hi</p>
    CSS:
    p { color: white; }
    p { color: black; }
    (a) white (b) blue (c) black (d) red
  5. 5.📱 max-width: 600px applies when the screen is ___. (a) exactly 1000px (b) turned off (c) 600px or wider (d) 600px or narrower
  6. 6.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 90px;
      padding: 30px;
      border: 5px solid black;
      margin: 10px;
    }
  7. 7.✍️ Which property is set to 20px in this rule?
    .box {
      font-style: italic;
      font-size: 20px;
      width: 300px;
    }
    (a) text-align (b) background-color (c) font-size (d) 20px
  8. 8.🌈 In #000022 the blue part is the hex number 22. What is it as a normal number?
  9. 9.🌈 What is the biggest number one colour can have in rgb()? (a) 255 (b) 99 (c) 100 (d) 1000
  10. 10.💪 Which flexbox property turns on flexbox? (a) gap (b) justify-content (c) align-items (d) display: flex
  11. 11.💪 How wide (px) is each gap between two boxes?
    .row {
      display: flex;
      width: 610px;
      justify-content: space-between;
    }
    Inside are 4 boxes, each 100px wide (no margins).
  12. 12.📱 What does a media query check? (a) the screen width (b) the battery level (c) the page title (d) the time of day
  13. 13.💪 Which justify-content value puts boxes in the middle? (a) space-between (b) flex-start (c) flex-end (d) center
  14. 14.🔍 Which is the odd one out? (a) rounds box corners (b) makes a form box (c) puts a picture on a page (d) makes a link
  15. 15.💪 Which flexbox property picks row or column? (a) display: flex (b) align-items (c) justify-content (d) flex-direction
  16. 16.True or false: padding is the gap round content. (a) True (b) False
  17. 17.🌈 Which colour is #000000? (a) blue (b) bright green (c) yellow (d) black
  18. 18.True or false: JavaScript makes headings and lists. (a) False (b) True
  19. 19.🧩 Which language gives the page structure? (a) HTML (b) CSS (c) JavaScript
  20. 20.What does color do? (a) sets the letter colour (b) makes letters bigger (c) centres a heading (d) colours behind the text
  21. 21.⚖️ Which selector is the strongest? (a) a class selector (b) an element selector (c) an id selector
  22. 22.🔍 Which is the odd one out? (a) makes a link (b) shows a pop-up message (c) checks a quiz answer (d) reacts to a button click
  23. 23.🌈 In #rrggbb, which colour do the first two digits give? (a) green (b) blue (c) red (d) black
  24. 24.🎯 Which element does the selector li style? (a) <div> (b) <p id="intro"> (c) <li class="red"> (d) <span class="red">
  25. 25.🌈 In #500000 the red part is the hex number 50. What is it as a normal number?
  26. 26.🎯 Which element does the selector div style? (a) <p class="note"> (b) <h1 id="logo"> (c) <span> (d) <div class="note">
  27. 27.💪 How much empty space (px) is before the first box?
    .row {
      display: flex;
      width: 440px;
      justify-content: center;
    }
    Inside are 4 boxes, each 100px wide (no margins).
  28. 28.True or false: padding is space outside the border. (a) True (b) False
  29. 29.📱 The screen is 320px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 12px;
    }
    @media (max-width: 1024px) {
      p {
        font-size: 6px;
      }
    }
  30. 30.True or false: the border is space inside the border. (a) False (b) True
  31. 31.Which of these does HTML do? (a) reacts to a button click (b) checks a quiz answer (c) makes headings and lists (d) shows a pop-up message
  32. 32.✍️ In color: blue; which part is the property? (a) ; (b) blue (c) : (d) color
  33. 33.🌈 In #rrggbb, which colour do the last two digits give? (a) red (b) white (c) green (d) blue
  34. 34.True or false: .note is a class selector. (a) True (b) False
  35. 35.🎨 Which tag connects an outside CSS file? (a) <link> (b) <a> (c) <img> (d) <css>
  36. 36.📱 The screen is 320px wide. Does the rule inside @media apply?
    p {
      font-size: 20px;
    }
    @media (min-width: 480px) {
      p {
        font-size: 28px;
      }
    }
    (a) Yes (b) No
  37. 37.✍️ Which property is set to 20px in this rule?
    .box {
      text-align: center;
      font-size: 20px;
      color: red;
    }
    (a) text-align (b) background-color (c) 20px (d) font-size
  38. 38.🎯 Which element does the selector .box style? (a) <div id="box"> (b) <span class="menu"> (c) <div class="star"> (d) <div class="box">
  39. 39.🧩 Which language lays out the page? (a) HTML (b) CSS (c) JavaScript
  40. 40.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 210px;
      padding: 5px;
      border: 5px solid black;
      margin: 0px;
    }

Answer key

  1. green
  2. 320
  3. the later one
  4. black
  5. 600px or narrower
  6. 180
  7. font-size
  8. 34
  9. 255
  10. display: flex
  11. 70
  12. the screen width
  13. center
  14. rounds box corners
  15. flex-direction
  16. True
  17. black
  18. False
  19. HTML
  20. sets the letter colour
  21. an id selector
  22. makes a link
  23. red
  24. <li class="red">
  25. 80
  26. <div class="note">
  27. 20
  28. False
  29. 6
  30. False
  31. makes headings and lists
  32. color
  33. blue
  34. True
  35. <link>
  36. No
  37. font-size
  38. <div class="box">
  39. CSS
  40. 230

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