← CSS test lesson New set →

CSS Worksheet: Practice Test

HTML and CSS lesson 20: CSS test · Set 192 · 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.True or false: JavaScript gives the page structure. (a) True (b) False
  2. 2.🎯 Which CSS selector matches this element?
    <li class="menu" id="intro">Hello</li>
    (a) div (b) li (c) .intro (d) #menu
  3. 3.✍️ In color: blue; which part is the property? (a) color (b) blue (c) : (d) ;
  4. 4.✍️ CSS declarations go inside which brackets? (a) { } (b) [ ] (c) ( ) (d) < >
  5. 5.🎨 Which tag connects an outside CSS file? (a) <css> (b) <a> (c) <link> (d) <img>
  6. 6.🌈 Which colour is rgb(0, 0, 0)? (a) cyan (b) blue (c) white (d) black
  7. 7.🌈 Which colour is #ffffff? (a) black (b) magenta (c) cyan (d) white
  8. 8.📱 The screen is 1366px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 24px;
    }
    @media (max-width: 1024px) {
      p {
        font-size: 20px;
      }
    }
  9. 9.Which of these does CSS do? (a) puts a picture on a page (b) rounds box corners (c) shows a pop-up message (d) changes the page live
  10. 10.True or false: JavaScript puts a picture on a page. (a) True (b) False
  11. 11.🌈 In #100000 the red part is the hex number 10. What is it as a normal number?
  12. 12.🎯 What kind of selector is .star? (a) an element selector (b) an id selector (c) a class selector
  13. 13.🎯 Which element does the selector p style? (a) <p class="menu"> (b) <h1> (c) <li id="end"> (d) <h2 class="menu">
  14. 14.🌈 Which colour is rgb(255, 0, 0)? (a) cyan (b) red (c) yellow (d) bright green
  15. 15.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 220px;
      padding: 30px;
      border: 3px solid black;
      margin: 0px;
    }
  16. 16.🎨 What does CSS stand for? (a) Creative Sheet System (b) Computer Style Sheets (c) Cascading Style Sheets (d) Colourful Site Styles
  17. 17.📱 The screen is 414px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 20px;
    }
    @media (min-width: 600px) {
      p {
        font-size: 26px;
      }
    }
  18. 18.📱 The screen is 540px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 12px;
    }
    @media (min-width: 768px) {
      p {
        font-size: 16px;
      }
    }
  19. 19.📱 max-width: 600px applies when the screen is ___. (a) turned off (b) 600px or wider (c) 600px or narrower (d) exactly 1000px
  20. 20.What does justify-content: center 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
  21. 21.🌈 Which colour of light is strongest in rgb(0, 0, 186)? (a) red (b) green (c) blue
  22. 22.🎯 Which element does the selector h2 style? (a) <div class="note"> (b) <h2 class="note"> (c) <li> (d) <span id="top">
  23. 23.True or false: padding is the gap round content. (a) True (b) False
  24. 24.📱 What does a media query check? (a) the battery level (b) the time of day (c) the screen width (d) the page title
  25. 25.True or false: the border is the gap to other boxes. (a) False (b) True
  26. 26.🖌️ What colour is behind the letters?
    h2 {
      text-align: right;
      font-size: 16px;
      color: black;
      background-color: purple;
    }
    (a) yellow (b) black (c) purple
  27. 27.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
    .box {
      width: 200px;
      padding: 25px;
      border: 3px solid black;
      margin: 15px;
    }
  28. 28.What does background-color do? (a) makes the text bold (b) colours behind the text (c) picks the font style (d) makes letters bigger
  29. 29.🎯 Which CSS selector matches this element?
    <p class="star" id="intro">Hello</p>
    (a) #intro (b) .intro (c) #main (d) .menu
  30. 30.📱 Which tag helps phones show a page at the right size? (a) the title tag (b) the viewport meta tag (c) the br tag (d) the hr tag
  31. 31.✍️ Which sign ends each CSS declaration? (a) . (b) , (c) : (d) ;
  32. 32.🌈 Which colour is #00ffff? (a) yellow (b) cyan (c) red (d) blue
  33. 33.🎯 Which CSS selector matches this element?
    <li class="menu" id="top">Hello</li>
    (a) #intro (b) li (c) .top (d) div
  34. 34.💪 Which flexbox property turns on flexbox? (a) justify-content (b) display: flex (c) flex-direction (d) align-items
  35. 35.True or false: JavaScript sets colours and fonts. (a) False (b) True
  36. 36.📱 The screen is 375px wide. What font-size (px) does the paragraph get?
    p {
      font-size: 16px;
    }
    @media (max-width: 600px) {
      p {
        font-size: 10px;
      }
    }
  37. 37.🖌️ What colour are the letters?
    h1 {
      background-color: white;
      text-align: left;
      font-size: 32px;
      color: orange;
    }
    (a) orange (b) red (c) white
  38. 38.True or false: #end is an element selector. (a) False (b) True
  39. 39.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 90px;
      padding: 30px;
      border: 1px solid black;
      margin: 10px;
    }
  40. 40.✍️ Which property is set to center in this rule?
    .note {
      background-color: yellow;
      margin: 10px;
      font-style: italic;
      text-align: center;
    }
    (a) background-color (b) center (c) margin (d) text-align

Answer key

  1. False
  2. li
  3. color
  4. { }
  5. <link>
  6. black
  7. white
  8. 24
  9. rounds box corners
  10. False
  11. 16
  12. a class selector
  13. <p class="menu">
  14. red
  15. 286
  16. Cascading Style Sheets
  17. 20
  18. 12
  19. 600px or narrower
  20. puts boxes in the middle
  21. blue
  22. <h2 class="note">
  23. True
  24. the screen width
  25. False
  26. purple
  27. 256
  28. colours behind the text
  29. #intro
  30. the viewport meta tag
  31. ;
  32. cyan
  33. li
  34. display: flex
  35. False
  36. 10
  37. orange
  38. False
  39. 172
  40. text-align

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