← CSS test lesson New set →

CSS Worksheet: Practice Test

HTML and CSS lesson 20: CSS test · Set 668 · 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 kind of selector is #main? (a) a class selector (b) an element selector (c) an id selector
  2. 2.🖌️ How big is the text, in px?
    li {
      background-color: black;
      text-align: right;
      font-size: 36px;
      color: orange;
    }
  3. 3.True or false: HTML shows a pop-up message. (a) True (b) False
  4. 4.True or false: .card is an id selector. (a) False (b) True
  5. 5.📱 The screen is 700px wide. Does the rule inside @media apply?
    p {
      font-size: 24px;
    }
    @media (max-width: 480px) {
      p {
        font-size: 20px;
      }
    }
    (a) Yes (b) No
  6. 6.🖌️ What colour is behind the letters?
    h1 {
      text-align: center;
      color: white;
      background-color: red;
      font-size: 28px;
    }
    (a) white (b) blue (c) red
  7. 7.✍️ In color: blue; which part is the property? (a) color (b) blue (c) ; (d) :
  8. 8.⚖️ Which selector is the weakest? (a) a class selector (b) an id selector (c) an element selector
  9. 9.💪 How much empty space (px) is left after the last box?
    .row {
      display: flex;
      width: 240px;
      justify-content: flex-start;
    }
    Inside are 4 boxes, each 50px wide (no margins).
  10. 10.💪 Which justify-content value equal gaps, none at ends? (a) space-between (b) center (c) flex-end (d) flex-start
  11. 11.💪 Which flexbox property spaces boxes along a row? (a) display: flex (b) align-items (c) justify-content (d) gap
  12. 12.🎯 Which element does the selector h2 style? (a) <span id="end"> (b) <div class="note"> (c) <li> (d) <h2 class="note">
  13. 13.✍️ What value is given to font-weight in this rule?
    body {
      font-weight: bold;
      background-color: yellow;
      padding: 8px;
    }
    (a) bold (b) font-weight (c) 2px solid (d) 300px
  14. 14.True or false: .note is an id selector. (a) True (b) False
  15. 15.🌈 In #00cc00 the green part is the hex number cc. What is it as a normal number?
  16. 16.💪 Which flexbox property lines boxes up across? (a) justify-content (b) align-items (c) gap (d) flex-direction
  17. 17.🌈 Which colour of light is strongest in rgb(29, 199, 77)? (a) green (b) blue (c) red
  18. 18.⚖️ What colour is the text of this element?
    <p class="box" id="logo">Hi</p>
    CSS:
    .box { color: purple; }
    p { color: yellow; }
    (a) yellow (b) red (c) orange (d) purple
  19. 19.🧩 Which language changes the page live? (a) CSS (b) JavaScript (c) HTML
  20. 20.🖌️ Which CSS property sets the letter colour? (a) font-size (b) font-family (c) text-align (d) color
  21. 21.Which of these does HTML do? (a) rounds box corners (b) shows a pop-up message (c) counts down a timer (d) makes a form box
  22. 22.🖌️ Where does the text sit on its line?
    h1 {
      text-align: right;
      font-size: 24px;
      background-color: yellow;
      color: green;
    }
    (a) in the middle (b) on the left (c) on the right
  23. 23.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
    .box {
      width: 240px;
      padding: 30px;
      border: 1px solid black;
      margin: 0px;
    }
  24. 24.💪 How much empty space (px) is left after the last box?
    .row {
      display: flex;
      width: 130px;
      justify-content: flex-start;
    }
    Inside are 2 boxes, each 60px wide (no margins).
  25. 25.Which of these does CSS do? (a) changes the page live (b) counts down a timer (c) sets colours and fonts (d) puts a picture on a page
  26. 26.Which of these does JavaScript do? (a) makes a form box (b) counts down a timer (c) gives the page structure (d) changes the text size
  27. 27.📱 Which tag helps phones show a page at the right size? (a) the viewport meta tag (b) the br tag (c) the hr tag (d) the title tag
  28. 28.🖌️ Which CSS property picks the font style? (a) color (b) text-align (c) font-size (d) font-family
  29. 29.✍️ What value is given to color in this rule?
    #top {
      color: red;
      text-align: center;
      font-size: 20px;
      background-color: yellow;
    }
    (a) color (b) red (c) 20px (d) center
  30. 30.What does font-weight do? (a) makes letters bigger (b) colours behind the text (c) makes the text bold (d) sets the letter colour
  31. 31.🎯 Which sign starts a class selector? (a) . (b) & (c) # (d) @
  32. 32.💪 How much empty space (px) is before the first box?
    .row {
      display: flex;
      width: 380px;
      justify-content: center;
    }
    Inside are 3 boxes, each 80px wide (no margins).
  33. 33.🖌️ How big is the text, in px?
    li {
      color: blue;
      background-color: yellow;
      font-size: 40px;
      text-align: left;
    }
  34. 34.🔍 Which is the odd one out? (a) gives the page structure (b) makes a form box (c) makes a link (d) reacts to a button click
  35. 35.🖌️ Which CSS property makes the text bold? (a) text-align (b) color (c) background-color (d) font-weight
  36. 36.📱 Responsive design means a page ___. (a) is only for laptops (b) fits every screen (c) never changes (d) has no pictures
  37. 37.True or false: JavaScript puts a picture on a page. (a) True (b) False
  38. 38.🖌️ What colour is behind the letters?
    p {
      font-size: 16px;
      text-align: center;
      color: white;
      background-color: black;
    }
    (a) black (b) white (c) blue
  39. 39.🔍 Which is the odd one out? (a) adds space around boxes (b) puts a picture on a page (c) makes a link (d) gives the page structure
  40. 40.📱 The screen is 1100px wide. Does the rule inside @media apply?
    p {
      font-size: 12px;
    }
    @media (min-width: 600px) {
      p {
        font-size: 14px;
      }
    }
    (a) No (b) Yes

Answer key

  1. an id selector
  2. 36
  3. False
  4. False
  5. No
  6. red
  7. color
  8. an element selector
  9. 40
  10. space-between
  11. justify-content
  12. <h2 class="note">
  13. bold
  14. False
  15. 204
  16. align-items
  17. green
  18. purple
  19. JavaScript
  20. color
  21. makes a form box
  22. on the right
  23. 302
  24. 10
  25. sets colours and fonts
  26. counts down a timer
  27. the viewport meta tag
  28. font-family
  29. red
  30. makes the text bold
  31. .
  32. 70
  33. 40
  34. reacts to a button click
  35. font-weight
  36. fits every screen
  37. False
  38. black
  39. adds space around boxes
  40. Yes

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