← Web development final test lesson New set →

Web Development Worksheet: Final Test

HTML and CSS lesson 30: Web development final test · Set 418 · 40 questions
TalentJR

Code tip (Read it like a browser): Find the topic: HTML, CSS, JavaScript or how the web works. Read the code line by line, the way a browser would. For sums and loops, write each step down and check it again.

NameDateTime takenScore ___ / 40
  1. 1.Which of these is a weak password? (a) S0lar!Pen#8 (b) iloveyou (c) Mango#Kite29! (d) Rain#Drop_42!
  2. 2.🖌️ How big is the text, in px?
    h1 {
      background-color: green;
      text-align: left;
      font-size: 16px;
      color: orange;
    }
  3. 3.🌈 Which colour is #ffff00? (a) red (b) cyan (c) blue (d) yellow
  4. 4.True or false: the URL shows the page to you. (a) True (b) False
  5. 5.🌈 Which colour of light is strongest in rgb(14, 186, 32)? (a) green (b) blue (c) red
  6. 6.🎯 Which CSS selector matches this element?
    <h1 class="note" id="top">Hello</h1>
    (a) #note (b) .top (c) h1 (d) h2
  7. 7.🖌️ What colour is behind the letters?
    li {
      background-color: purple;
      font-size: 12px;
      text-align: right;
      color: yellow;
    }
    (a) purple (b) blue (c) yellow
  8. 8.🖌️ Which CSS property centres a heading? (a) background-color (b) color (c) font-size (d) text-align
  9. 9.🔁 Which word runs code only when something is true? (a) let (b) if (c) for (d) log
  10. 10.What does justify-content: space-between do? (a) puts boxes in the middle (b) packs boxes at the start (c) equal gaps, none at ends (d) packs boxes at the end
  11. 11.True or false: <img src="cat.png"> goes in index.html. (a) True (b) False
  12. 12.📋 What number does the browser show next to “Banana”?
    <ol start="4">
      <li>Jamun</li>
      <li>Banana</li>
      <li>Mango</li>
      <li>Papaya</li>
    </ol>
  13. 13.🖼️ Which picture file does the browser load?
    <img src="dog.jpg" alt="A happy dog" width="200">
    (a) bus.jpg (b) dog.jpg (c) A happy dog (d) moon.png
  14. 14.Which of these goes in the body? (a) <style> (b) <meta charset="utf-8"> (c) <title> (d) <a>
  15. 15.🎯 Which CSS selector matches this element?
    <p class="big" id="logo">Hello</p>
    (a) #big (b) p (c) .logo (d) h1
  16. 16.🚀 Which file should this code go in: let score = 0; (a) index.html (b) style.css (c) script.js
  17. 17.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Space Facts</title>
    </head>
    <body>
      <h1>Easy snacks</h1>
      <p>I like to read.</p>
    </body>
    </html>
    (a) I like to read. (b) body (c) Easy snacks (d) Space Facts
  18. 18.📄 Where does the text of <title> appear? (a) nowhere (b) in a big heading (c) at the bottom (d) on the browser tab
  19. 19.🔁 What number does this code print?
    let total = 0;
    for (let i = 1; i <= 6; i++) {
      total = total + i;
    }
    console.log(total);
  20. 20.📄 Can HTML on its own add up two numbers? (a) Yes (b) No
  21. 21.✍️ How many declarations (property: value pairs) are in this rule?
    .note {
      width: 300px;
      padding: 8px;
    }
  22. 22.🔁 How many times does this code print “Welcome”?
    for (let i = 3; i < 9; i++) {
      console.log("Welcome");
    }
  23. 23.🔗 Which address opens when you click this link?
    <a href="about.html">About us</a>
    (a) About us (b) https://example.com (c) contact.html (d) about.html
  24. 24.📄 What is the first line of an HTML5 page? (a) <!DOCTYPE html> (b) <head> (c) <body> (d) <html>
  25. 25.🚀 Which file is best for code that reacts to clicks? (a) index.html (b) style.css (c) script.js (d) notes.txt
  26. 26.⚡ Where does console.log() show its output? (a) on the title bar (b) on the printer (c) in the console (d) in the address bar
  27. 27.⚡ What does this code print? (Look at the quotes!)
    let x = "6";
    let y = 4;
    console.log(x + y);
    (a) 10 (b) Error (c) 64
  28. 28.🔍 Which is the odd one out? (a) saves our .html files (b) shows line numbers (c) opens web pages for us (d) colours code to help us
  29. 29.Which of these is a closing tag? (a) </li> (b) <p> (c) <body> (d) <h1>
  30. 30.⚡ What does this code show?
    let name = "Kabir";
    console.log("Hello, " + name + "!");
    (a) name (b) Hello, name! (c) Hello, Kabir! (d) Kabir
  31. 31.True or false: <h1>My Site</h1> goes in script.js. (a) True (b) False
  32. 32.True or false: CSS sets colours and fonts. (a) True (b) False
  33. 33.True or false: CSS rounds box corners. (a) False (b) True
  34. 34.🏷️ Which is the closing tag for <small>? (a) <small> (b) <\small> (c) </small> (d) <small/>
  35. 35.📊 How many heading cells (<th>) does this table have?
    <table>
      <tr><th>Name</th><th>Fruit</th></tr>
      <tr><td>Banana</td><td>Papaya</td></tr>
      <tr><td>Banana</td><td>Guava</td></tr>
      <tr><td>Banana</td><td>Orange</td></tr>
    </table>
  36. 36.Which of these is a weak password? (a) Chai$Cup_19x (b) Rain#Drop_42! (c) Mango#Kite29! (d) riya2014
  37. 37.🔗 Which words do you click on?
    <a href="art.html">Play games</a>
    (a) href (b) Play games (c) art.html (d) About us
  38. 38.🔁 What is the LAST number this code prints?
    for (let i = 0; i < 17; i = i + 4) {
      console.log(i);
    }
  39. 39.What does font-weight do? (a) makes the text bold (b) sets the letter colour (c) colours behind the text (d) centres a heading
  40. 40.🖌️ Where does the text sit on its line?
    h2 {
      text-align: left;
      font-size: 12px;
      background-color: black;
      color: blue;
    }
    (a) on the left (b) in the middle (c) on the right

Answer key

  1. iloveyou
  2. 16
  3. yellow
  4. False
  5. green
  6. h1
  7. purple
  8. text-align
  9. if
  10. equal gaps, none at ends
  11. True
  12. 5
  13. dog.jpg
  14. <a>
  15. p
  16. script.js
  17. Easy snacks
  18. on the browser tab
  19. 21
  20. No
  21. 2
  22. 6
  23. about.html
  24. <!DOCTYPE html>
  25. script.js
  26. in the console
  27. 64
  28. opens web pages for us
  29. </li>
  30. Hello, Kabir!
  31. False
  32. True
  33. True
  34. </small>
  35. 2
  36. riya2014
  37. Play games
  38. 16
  39. makes the text bold
  40. on the left

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