← CSS test lesson New set →

CSS Worksheet: Practice Test

HTML and CSS lesson 20: CSS test · Set 24 · 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.🎨 A CSS file usually ends with which extension? (a) .css (b) .html (c) .js (d) .png
  2. 2.What does font-family do? (a) picks the font style (b) colours behind the text (c) makes letters bigger (d) makes the text bold
  3. 3.🧩 Which language gives the page structure? (a) HTML (b) JavaScript (c) CSS
  4. 4.Which of these does CSS do? (a) gives the page structure (b) shows a pop-up message (c) makes a link (d) changes the text size
  5. 5.🖌️ Which CSS property makes letters bigger? (a) color (b) font-size (c) font-family (d) background-color
  6. 6.📦 How much space top to bottom (px) does this box take in all, margin included?
    .box {
      height: 70px;
      padding: 20px;
      border: 1px solid black;
      margin: 5px;
    }
  7. 7.⚖️ Two rules with the same selector set a colour. Which one wins? (a) neither (b) the shorter one (c) the first one (d) the later one
  8. 8.🧩 Which language changes the page live? (a) HTML (b) CSS (c) JavaScript
  9. 9.🎯 Which sign starts a class selector? (a) & (b) # (c) . (d) @
  10. 10.True or false: CSS makes a link. (a) True (b) False
  11. 11.Which of these does HTML do? (a) reacts to a button click (b) makes a form box (c) sets colours and fonts (d) shows a pop-up message
  12. 12.🌈 Which colour is #000000? (a) red (b) black (c) bright green (d) white
  13. 13.True or false: p is an element selector. (a) False (b) True
  14. 14.📱 The screen is 1366px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 16px;
    }
    @media (min-width: 768px) {
      p {
        font-size: 20px;
      }
    }
  15. 15.🧩 Which language changes the text size? (a) JavaScript (b) CSS (c) HTML
  16. 16.⚖️ What colour is the text of this element?
    <h1 class="menu" id="hero">Hi</h1>
    CSS:
    .menu { color: black; }
    .menu { color: yellow; }
    (a) black (b) blue (c) orange (d) yellow
  17. 17.🖌️ What colour are the letters?
    h2 {
      background-color: green;
      text-align: left;
      font-size: 16px;
      color: purple;
    }
    (a) green (b) black (c) purple
  18. 18.📱 The screen is 414px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 12px;
    }
    @media (min-width: 1024px) {
      p {
        font-size: 14px;
      }
    }
  19. 19.🎯 Which CSS selector matches this element?
    <p class="red" id="end">Hello</p>
    (a) #red (b) .box (c) .red (d) .end
  20. 20.🌈 What is the biggest number one colour can have in rgb()? (a) 100 (b) 99 (c) 1000 (d) 255
  21. 21.🧩 Which language rounds box corners? (a) HTML (b) JavaScript (c) CSS
  22. 22.🌈 Which colour of light is strongest in rgb(206, 34, 12)? (a) blue (b) red (c) green
  23. 23.🎯 Which CSS selector matches this element?
    <span class="big" id="top">Hello</span>
    (a) span (b) .red (c) p (d) .top
  24. 24.📱 The screen is 320px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 20px;
    }
    @media (max-width: 1024px) {
      p {
        font-size: 16px;
      }
    }
  25. 25.✍️ What is the selector in this CSS rule?
    #top {
      background-color: yellow;
      font-size: 20px;
      border: 2px solid;
    }
    (a) li (b) 20px (c) background-color (d) #top
  26. 26.📱 The screen is 320px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 16px;
    }
    @media (min-width: 1024px) {
      p {
        font-size: 24px;
      }
    }
  27. 27.True or false: body is a class selector. (a) False (b) True
  28. 28.🖌️ How big is the text, in px?
    h1 {
      background-color: white;
      color: red;
      font-size: 36px;
      text-align: left;
    }
  29. 29.📱 The screen is 820px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 20px;
    }
    @media (max-width: 480px) {
      p {
        font-size: 16px;
      }
    }
  30. 30.True or false: CSS gives the page structure. (a) False (b) True
  31. 31.True or false: HTML checks a quiz answer. (a) True (b) False
  32. 32.📱 The screen is 375px wide. Does the rule inside @media apply?
    p {
      font-size: 24px;
    }
    @media (min-width: 1024px) {
      p {
        font-size: 32px;
      }
    }
    (a) Yes (b) No
  33. 33.🎯 What kind of selector is .note? (a) an id selector (b) an element selector (c) a class selector
  34. 34.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
    .box {
      width: 170px;
      padding: 20px;
      border: 4px solid black;
      margin: 15px;
    }
  35. 35.🎯 Which CSS selector matches this element?
    <h1 class="red" id="intro">Hello</h1>
    (a) #red (b) .box (c) #main (d) #intro
  36. 36.🌈 In #180000 the red part is the hex number 18. What is it as a normal number?
  37. 37.⚖️ What colour is the text of this element?
    <h1 class="red" id="top">Hi</h1>
    CSS:
    h1 { color: blue; }
    #top { color: black; }
    (a) blue (b) white (c) black (d) red
  38. 38.🎨 One CSS file can style how many pages? (a) only one image (b) no pages (c) only one word (d) many pages
  39. 39.✍️ Which sign goes between a property and its value? (a) - (b) : (c) ; (d) =
  40. 40.📱 The screen is 820px wide. Does the rule inside @media apply?
    p {
      font-size: 16px;
    }
    @media (max-width: 1024px) {
      p {
        font-size: 10px;
      }
    }
    (a) No (b) Yes

Answer key

  1. .css
  2. picks the font style
  3. HTML
  4. changes the text size
  5. font-size
  6. 122
  7. the later one
  8. JavaScript
  9. .
  10. False
  11. makes a form box
  12. black
  13. True
  14. 20
  15. CSS
  16. yellow
  17. purple
  18. 12
  19. .red
  20. 255
  21. CSS
  22. red
  23. span
  24. 16
  25. #top
  26. 16
  27. False
  28. 36
  29. 20
  30. False
  31. False
  32. No
  33. a class selector
  34. 218
  35. #intro
  36. 24
  37. black
  38. many pages
  39. :
  40. Yes

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