← CSS test lesson New set →

CSS Worksheet: Practice Test

HTML and CSS lesson 20: CSS test · Set 230 · 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 of these does HTML do? (a) changes the text size (b) reacts to a button click (c) makes headings and lists (d) checks a quiz answer
  2. 2.🎯 Which CSS selector matches this element?
    <h1 class="note" id="hero">Hello</h1>
    (a) .hero (b) h2 (c) #hero (d) .big
  3. 3.🔍 Which is the odd one out? (a) makes a form box (b) adds space around boxes (c) sets colours and fonts (d) lays out the page
  4. 4.🔍 Which is the odd one out? (a) shows a pop-up message (b) counts down a timer (c) sets colours and fonts (d) changes the page live
  5. 5.🌈 Which colour is #00ffff? (a) white (b) cyan (c) blue (d) magenta
  6. 6.⚖️ Which selector is the weakest? (a) a class selector (b) an id selector (c) an element selector
  7. 7.💪 Which justify-content value packs boxes at the end? (a) flex-start (b) space-between (c) flex-end (d) center
  8. 8.✍️ In color: blue; which part is the value? (a) color (b) ; (c) blue (d) :
  9. 9.💪 How much empty space (px) is left after the last box?
    .row {
      display: flex;
      width: 360px;
      justify-content: flex-start;
    }
    Inside are 3 boxes, each 100px wide (no margins).
  10. 10.💪 How much empty space (px) is left after the last box?
    .row {
      display: flex;
      width: 120px;
      justify-content: flex-start;
    }
    Inside are 2 boxes, each 50px wide (no margins).
  11. 11.📱 The screen is 320px wide. Does the rule inside @media apply?
    p {
      font-size: 12px;
    }
    @media (max-width: 768px) {
      p {
        font-size: 10px;
      }
    }
    (a) No (b) Yes
  12. 12.🎯 Which CSS selector matches this element?
    <h2 class="star" id="main">Hello</h2>
    (a) #logo (b) .menu (c) li (d) h2
  13. 13.✍️ How does a CSS comment start? (a) // (b) # (c) <!-- (d) /*
  14. 14.🎯 Which CSS selector matches this element?
    <h2 class="menu" id="intro">Hello</h2>
    (a) #menu (b) li (c) .note (d) #intro
  15. 15.🖌️ What colour are the letters?
    h1 {
      background-color: green;
      font-size: 28px;
      color: orange;
      text-align: center;
    }
    (a) black (b) orange (c) green
  16. 16.⚖️ What colour is the text of this element?
    <h1 class="note" id="intro">Hi</h1>
    CSS:
    h1 { color: blue; }
    h1 { color: green; }
    (a) blue (b) green (c) black (d) orange
  17. 17.📱 The screen is 1366px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 24px;
    }
    @media (min-width: 768px) {
      p {
        font-size: 32px;
      }
    }
  18. 18.🖌️ How big is the text, in px?
    h2 {
      color: red;
      background-color: yellow;
      text-align: right;
      font-size: 32px;
    }
  19. 19.📱 The screen is 414px wide. Does the rule inside @media apply?
    p {
      font-size: 24px;
    }
    @media (min-width: 1024px) {
      p {
        font-size: 32px;
      }
    }
    (a) Yes (b) No
  20. 20.🌈 What is the biggest number one colour can have in rgb()? (a) 255 (b) 1000 (c) 100 (d) 99
  21. 21.🖌️ Which CSS property picks the font style? (a) font-family (b) font-size (c) background-color (d) color
  22. 22.Which of these does JavaScript do? (a) sets colours and fonts (b) gives the page structure (c) makes headings and lists (d) shows a pop-up message
  23. 23.📦 In the box model, which part is the line round the box? (a) content (b) padding (c) margin (d) border
  24. 24.📱 The screen is 320px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 20px;
    }
    @media (max-width: 768px) {
      p {
        font-size: 18px;
      }
    }
  25. 25.🖌️ Which CSS property colours behind the text? (a) background-color (b) font-weight (c) color (d) text-align
  26. 26.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 110px;
      padding: 30px;
      border: 5px solid black;
      margin: 5px;
    }
  27. 27.🖌️ Which CSS property makes the text bold? (a) font-family (b) font-size (c) font-weight (d) text-align
  28. 28.📱 Responsive design means a page ___. (a) never changes (b) fits every screen (c) is only for laptops (d) has no pictures
  29. 29.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
    .box {
      width: 270px;
      padding: 20px;
      border: 4px solid black;
      margin: 0px;
    }
  30. 30.🎯 Which element does the selector .box style? (a) <h1 class="menu"> (b) <p class="star"> (c) <p id="box"> (d) <p class="box">
  31. 31.📱 min-width: 800px applies when the screen is ___. (a) 800px or wider (b) exactly 100px (c) turned off (d) 800px or narrower
  32. 32.🎯 Which CSS selector matches this element?
    <span class="big" id="intro">Hello</span>
    (a) .red (b) .intro (c) #intro (d) #big
  33. 33.🌈 Which colour is #00ff00? (a) red (b) bright green (c) magenta (d) cyan
  34. 34.📱 The screen is 320px wide. Does the rule inside @media apply?
    p {
      font-size: 24px;
    }
    @media (min-width: 480px) {
      p {
        font-size: 28px;
      }
    }
    (a) No (b) Yes
  35. 35.🎨 What does CSS stand for? (a) Colourful Site Styles (b) Computer Style Sheets (c) Creative Sheet System (d) Cascading Style Sheets
  36. 36.💪 How much empty space (px) is before the first box?
    .row {
      display: flex;
      width: 120px;
      justify-content: center;
    }
    Inside are 2 boxes, each 40px wide (no margins).
  37. 37.⚖️ What colour is the text of this element?
    <p class="red" id="logo">Hi</p>
    CSS:
    p { color: white; }
    p { color: red; }
    (a) blue (b) red (c) purple (d) white
  38. 38.⚖️ What colour is the text of this element?
    <h1 class="red" id="main">Hi</h1>
    CSS:
    #main { color: black; }
    .red { color: blue; }
    h1 { color: red; }
    (a) blue (b) orange (c) black (d) red
  39. 39.🎨 One CSS file can style how many pages? (a) no pages (b) only one image (c) many pages (d) only one word
  40. 40.🖌️ What colour is behind the letters?
    p {
      background-color: blue;
      text-align: center;
      font-size: 12px;
      color: yellow;
    }
    (a) purple (b) yellow (c) blue

Answer key

  1. makes headings and lists
  2. #hero
  3. makes a form box
  4. sets colours and fonts
  5. cyan
  6. an element selector
  7. flex-end
  8. blue
  9. 60
  10. 20
  11. Yes
  12. h2
  13. /*
  14. #intro
  15. orange
  16. green
  17. 32
  18. 32
  19. No
  20. 255
  21. font-family
  22. shows a pop-up message
  23. border
  24. 18
  25. background-color
  26. 190
  27. font-weight
  28. fits every screen
  29. 318
  30. <p class="box">
  31. 800px or wider
  32. #intro
  33. bright green
  34. No
  35. Cascading Style Sheets
  36. 20
  37. red
  38. black
  39. many pages
  40. blue

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