← CSS test lesson New set →

CSS Worksheet: Practice Test

HTML and CSS lesson 20: CSS test · Set 663 · 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 does CSS stand for? (a) Colourful Site Styles (b) Creative Sheet System (c) Computer Style Sheets (d) Cascading Style Sheets
  2. 2.📦 In the box model, which part is a solid or dotted edge? (a) border (b) padding (c) margin (d) content
  3. 3.💪 Which justify-content value puts boxes in the middle? (a) flex-start (b) space-between (c) flex-end (d) center
  4. 4.✍️ What value is given to color in this rule?
    li {
      background-color: yellow;
      font-weight: bold;
      font-size: 20px;
      color: red;
    }
    (a) center (b) 20px (c) red (d) color
  5. 5.🧩 Which language makes a link? (a) CSS (b) JavaScript (c) HTML
  6. 6.💪 How much empty space (px) is before the first box?
    .row {
      display: flex;
      width: 250px;
      justify-content: flex-end;
    }
    Inside are 3 boxes, each 80px wide (no margins).
  7. 7.📦 How much space top to bottom (px) does this box take in all, margin included?
    .box {
      height: 140px;
      padding: 15px;
      border: 5px solid black;
      margin: 0px;
    }
  8. 8.✍️ CSS declarations go inside which brackets? (a) [ ] (b) { } (c) < > (d) ( )
  9. 9.✍️ How many declarations (property: value pairs) are in this rule?
    .box {
      color: red;
    }
  10. 10.⚖️ What colour is the text of this element?
    <h1 class="box" id="intro">Hi</h1>
    CSS:
    .box { color: blue; }
    .box { color: orange; }
    (a) green (b) blue (c) yellow (d) orange
  11. 11.🌈 Which hex code is red? (a) #ff0000 (b) #00ff00 (c) #ffff00 (d) #ff00ff
  12. 12.📱 Responsive design means a page ___. (a) is only for laptops (b) never changes (c) fits every screen (d) has no pictures
  13. 13.True or false: the border is the line round the box. (a) False (b) True
  14. 14.📱 The screen is 540px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 16px;
    }
    @media (min-width: 480px) {
      p {
        font-size: 24px;
      }
    }
  15. 15.🌈 Which colour of light is strongest in rgb(117, 125, 193)? (a) green (b) red (c) blue
  16. 16.⚖️ What colour is the text of this element?
    <h2 class="note" id="intro">Hi</h2>
    CSS:
    #intro { color: blue; }
    #intro { color: green; }
    (a) white (b) red (c) blue (d) green
  17. 17.What does justify-content: flex-start do? (a) packs boxes at the start (b) puts boxes in the middle (c) equal gaps, none at ends (d) packs boxes at the end
  18. 18.🎯 Which CSS selector matches this element?
    <li class="big" id="logo">Hello</li>
    (a) .big (b) .logo (c) .red (d) #end
  19. 19.🎯 Which element does the selector #logo style? (a) <h1 class="box"> (b) <p id="logo"> (c) <p id="end"> (d) <p class="logo">
  20. 20.⚖️ What colour is the text of this element?
    <h2 class="note" id="end">Hi</h2>
    CSS:
    #end { color: orange; }
    #end { color: yellow; }
    (a) orange (b) white (c) yellow (d) purple
  21. 21.🎯 What kind of selector is #logo? (a) a class selector (b) an id selector (c) an element selector
  22. 22.💪 How wide (px) is each gap between two boxes?
    .row {
      display: flex;
      width: 130px;
      justify-content: space-between;
    }
    Inside are 2 boxes, each 60px wide (no margins).
  23. 23.🖌️ What colour is behind the letters?
    h1 {
      background-color: black;
      color: green;
      text-align: center;
      font-size: 24px;
    }
    (a) white (b) green (c) black
  24. 24.🖌️ How big is the text, in px?
    li {
      font-size: 12px;
      background-color: orange;
      text-align: center;
      color: green;
    }
  25. 25.True or false: JavaScript makes a form box. (a) False (b) True
  26. 26.📱 The screen is 1100px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 12px;
    }
    @media (min-width: 600px) {
      p {
        font-size: 14px;
      }
    }
  27. 27.True or false: #end is an id selector. (a) True (b) False
  28. 28.🖌️ How big is the text, in px?
    h2 {
      background-color: black;
      text-align: center;
      font-size: 12px;
      color: white;
    }
  29. 29.📱 The screen is 820px wide. Does the rule inside @media apply?
    p {
      font-size: 20px;
    }
    @media (min-width: 600px) {
      p {
        font-size: 26px;
      }
    }
    (a) No (b) Yes
  30. 30.Which of these does HTML do? (a) adds space around boxes (b) reacts to a button click (c) changes the text size (d) makes a link
  31. 31.📱 The screen is 375px wide. Does the rule inside @media apply?
    p {
      font-size: 24px;
    }
    @media (max-width: 480px) {
      p {
        font-size: 20px;
      }
    }
    (a) Yes (b) No
  32. 32.📦 In the box model, which part is space outside the border? (a) margin (b) padding (c) content (d) border
  33. 33.🎯 What kind of selector is .note? (a) a class selector (b) an id selector (c) an element selector
  34. 34.🌈 Which colour is #ff00ff? (a) magenta (b) red (c) cyan (d) bright green
  35. 35.✍️ What value is given to border in this rule?
    .box {
      border: 2px solid;
      font-weight: bold;
      width: 300px;
      padding: 8px;
    }
    (a) italic (b) 300px (c) 2px solid (d) border
  36. 36.✍️ Which property is set to 8px in this rule?
    body {
      padding: 8px;
      font-style: italic;
    }
    (a) font-weight (b) 8px (c) border (d) padding
  37. 37.True or false: JavaScript counts down a timer. (a) True (b) False
  38. 38.📱 The screen is 1100px wide. Does the rule inside @media apply?
    p {
      font-size: 12px;
    }
    @media (min-width: 600px) {
      p {
        font-size: 18px;
      }
    }
    (a) Yes (b) No
  39. 39.✍️ What is the selector in this CSS rule?
    .note {
      width: 300px;
      font-weight: bold;
    }
    (a) bold (b) #top (c) .note (d) width
  40. 40.⚖️ What colour is the text of this element?
    <h1 class="menu" id="logo">Hi</h1>
    CSS:
    h1 { color: white; }
    #logo { color: red; }
    (a) white (b) red (c) green (d) orange

Answer key

  1. Cascading Style Sheets
  2. border
  3. center
  4. red
  5. HTML
  6. 10
  7. 180
  8. { }
  9. 1
  10. orange
  11. #ff0000
  12. fits every screen
  13. True
  14. 24
  15. blue
  16. green
  17. packs boxes at the start
  18. .big
  19. <p id="logo">
  20. yellow
  21. an id selector
  22. 10
  23. black
  24. 12
  25. False
  26. 14
  27. True
  28. 12
  29. Yes
  30. makes a link
  31. Yes
  32. margin
  33. a class selector
  34. magenta
  35. 2px solid
  36. padding
  37. True
  38. Yes
  39. .note
  40. red

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