← CSS test lesson New set →

CSS Worksheet: Practice Test

HTML and CSS lesson 20: CSS test · Set 687 · 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 language rounds box corners? (a) JavaScript (b) CSS (c) HTML
  2. 2.💪 Which justify-content value equal gaps, none at ends? (a) space-between (b) flex-end (c) flex-start (d) center
  3. 3.🎯 Which element does the selector #main style? (a) <div class="note"> (b) <li id="main"> (c) <li id="logo"> (d) <li class="main">
  4. 4.True or false: the content is a solid or dotted edge. (a) False (b) True
  5. 5.📱 Responsive design means a page ___. (a) is only for laptops (b) never changes (c) has no pictures (d) fits every screen
  6. 6.🌈 In #001800 the green part is the hex number 18. What is it as a normal number?
  7. 7.🖌️ How big is the text, in px?
    li {
      text-align: left;
      font-size: 24px;
      background-color: orange;
      color: green;
    }
  8. 8.🌈 In #260000 the red part is the hex number 26. What is it as a normal number?
  9. 9.🎯 Which element does the selector #intro style? (a) <span id="main"> (b) <span class="intro"> (c) <span id="intro"> (d) <p class="menu">
  10. 10.🌈 Which colour of light is strongest in rgb(15, 132, 255)? (a) red (b) green (c) blue
  11. 11.💪 Which flexbox property turns on flexbox? (a) align-items (b) justify-content (c) flex-direction (d) display: flex
  12. 12.🎯 What kind of selector is #logo? (a) an element selector (b) a class selector (c) an id selector
  13. 13.True or false: .note is a class selector. (a) True (b) False
  14. 14.⚖️ What colour is the text of this element?
    <p class="box" id="top">Hi</p>
    CSS:
    p { color: black; }
    .box { color: blue; }
    (a) black (b) green (c) blue (d) purple
  15. 15.🎨 Which attribute adds CSS inside one tag? (a) alt (b) src (c) style (d) href
  16. 16.🌈 Which colour is rgb(0, 0, 255)? (a) bright green (b) red (c) cyan (d) blue
  17. 17.What does justify-content: flex-end do? (a) packs boxes at the end (b) puts boxes in the middle (c) packs boxes at the start (d) equal gaps, none at ends
  18. 18.📦 In the box model, which part is space inside the border? (a) margin (b) border (c) content (d) padding
  19. 19.🎯 Which CSS selector matches this element?
    <h1 class="box" id="main">Hello</h1>
    (a) .box (b) #box (c) .star (d) #logo
  20. 20.✍️ Which property is set to 8px in this rule?
    .note {
      font-style: italic;
      padding: 8px;
      font-size: 20px;
    }
    (a) padding (b) border (c) 8px (d) font-weight
  21. 21.⚖️ What colour is the text of this element?
    <h1 class="box" id="logo">Hi</h1>
    CSS:
    h1 { color: orange; }
    .box { color: purple; }
    (a) green (b) orange (c) purple (d) blue
  22. 22.✍️ In color: blue; which part is the value? (a) color (b) : (c) blue (d) ;
  23. 23.🌈 In #002d00 the green part is the hex number 2d. What is it as a normal number?
  24. 24.⚖️ What colour is the text of this element?
    <p class="box" id="intro">Hi</p>
    CSS:
    #intro { color: orange; }
    .box { color: red; }
    (a) black (b) orange (c) red (d) white
  25. 25.💪 How much empty space (px) is before the first box?
    .row {
      display: flex;
      width: 260px;
      justify-content: center;
    }
    Inside are 3 boxes, each 60px wide (no margins).
  26. 26.🖌️ How big is the text, in px?
    li {
      font-size: 12px;
      background-color: orange;
      text-align: right;
      color: red;
    }
  27. 27.⚖️ What colour is the text of this element?
    <h1 class="note" id="hero">Hi</h1>
    CSS:
    #hero { color: blue; }
    h1 { color: orange; }
    (a) green (b) purple (c) blue (d) orange
  28. 28.🎯 Which element does the selector div style? (a) <h1 id="top"> (b) <div class="note"> (c) <span> (d) <p class="note">
  29. 29.🖌️ What colour are the letters?
    h1 {
      font-size: 20px;
      color: blue;
      background-color: orange;
      text-align: right;
    }
    (a) green (b) orange (c) blue
  30. 30.⚖️ Which selector is the strongest? (a) a class selector (b) an element selector (c) an id selector
  31. 31.🎯 Which sign starts an id selector? (a) . (b) @ (c) & (d) #
  32. 32.💪 Which flexbox property picks row or column? (a) justify-content (b) flex-direction (c) align-items (d) display: flex
  33. 33.💪 Which justify-content value packs boxes at the end? (a) center (b) flex-end (c) flex-start (d) space-between
  34. 34.🎯 How many elements on a page should have the same id? (a) any number (b) 1 (c) 2 (d) 5
  35. 35.🎯 Can many elements share the same class? (a) No (b) Yes
  36. 36.🌈 In #000027 the blue part is the hex number 27. What is it as a normal number?
  37. 37.True or false: margin is the gap round content. (a) True (b) False
  38. 38.True or false: .big is a class selector. (a) False (b) True
  39. 39.✍️ In color: blue; which part is the property? (a) ; (b) color (c) : (d) blue
  40. 40.🖌️ What colour is behind the letters?
    h2 {
      background-color: yellow;
      text-align: right;
      color: orange;
      font-size: 40px;
    }
    (a) orange (b) white (c) yellow

Answer key

  1. CSS
  2. space-between
  3. <li id="main">
  4. False
  5. fits every screen
  6. 24
  7. 24
  8. 38
  9. <span id="intro">
  10. blue
  11. display: flex
  12. an id selector
  13. True
  14. blue
  15. style
  16. blue
  17. packs boxes at the end
  18. padding
  19. .box
  20. padding
  21. purple
  22. blue
  23. 45
  24. orange
  25. 40
  26. 12
  27. blue
  28. <div class="note">
  29. blue
  30. an id selector
  31. #
  32. flex-direction
  33. flex-end
  34. 1
  35. Yes
  36. 39
  37. False
  38. True
  39. color
  40. yellow

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