← Web development final test lesson New set →

Web Development Worksheet: Final Test

HTML and CSS lesson 30: Web development final test · Set 764 · 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.⚡ What number does this code print?
    let coins = 15;
    coins = coins + 9;
    coins = coins - 12;
    console.log(coins);
  2. 2.True or false: the browser is the page’s address. (a) True (b) False
  3. 3.🖼️ Does <img> need a closing tag? (a) No (b) Yes
  4. 4.📊 How many cells are in each row?
    <table>
      <tr><td>Mango</td><td>Mango</td><td>Grapes</td><td>Guava</td></tr>
      <tr><td>Guava</td><td>Guava</td><td>Orange</td><td>Banana</td></tr>
    </table>
  5. 5.✍️ What is the selector in this CSS rule?
    .box {
      background-color: yellow;
      font-style: italic;
    }
    (a) italic (b) h2 (c) background-color (d) .box
  6. 6.⚡ What number does this code print?
    let a = 7;
    let b = 9;
    console.log(a + b);
  7. 7.🔍 Which is the odd one out? (a) is where we type code (b) answers page requests (c) colours code to help us (d) saves our .html files
  8. 8.📄 Where does <link rel="stylesheet"> go: in the head or in the body? (a) in the head (b) in the body
  9. 9.True or false: in <img>, height shows if the image fails. (a) True (b) False
  10. 10.🔁 When does the else part run? (a) when if is false (b) when if is true (c) always (d) never
  11. 11.🔠 Which heading shows the SMALLEST text: <h6>, <h1>, <h2> or <h4>? (a) <h2> (b) <h1> (c) <h4> (d) <h6>
  12. 12.🔍 Which line is missing its closing tag?
    line 1: <em>My pets
    line 2: <h1>Cricket is fun.</h1>
    line 3: <strong>Hello, world!</strong>
    (a) line 2 (b) line 3 (c) line 1
  13. 13.🖼️ Which attribute of <img> names the picture file? (a) alt (b) width (c) src (d) height
  14. 14.💬 Which text will NOT show on the page?
    <!-- <p>I love mangoes.</p> -->
    <p>My best friend</p>
    <p>Rain today</p>
    (a) My best friend (b) Rain today (c) I love mangoes.
  15. 15.⚡ Which JavaScript word repeats code? (a) if (b) let (c) for (d) alert()
  16. 16.🖌️ What colour is behind the letters?
    h2 {
      color: orange;
      background-color: yellow;
      font-size: 40px;
      text-align: right;
    }
    (a) orange (b) green (c) yellow
  17. 17.True or false: HTML on its own can pick a random number. (a) False (b) True
  18. 18.🎯 What kind of selector is #main? (a) an id selector (b) an element selector (c) a class selector
  19. 19.🎯 Which CSS selector matches this element?
    <p class="note" id="main">Hello</p>
    (a) .big (b) .note (c) h1 (d) .main
  20. 20.✍️ What value is given to padding in this rule?
    li {
      text-align: center;
      padding: 8px;
      font-size: 20px;
    }
    (a) bold (b) padding (c) 2px solid (d) 8px
  21. 21.🔁 What does this code print?
    let age = 2;
    if (age > 15) {
      console.log("teen");
    } else {
      console.log("child");
    }
    (a) teen (b) child
  22. 22.📦 In the box model, which part is the line round the box? (a) border (b) padding (c) margin (d) content
  23. 23.♿ Does this help everyone, or make the page harder to use: tiny grey text? (a) helps everyone (b) makes it harder
  24. 24.📦 How wide (px) is this box from the outer edge of its left border to the outer edge of its right border?
    .box {
      width: 70px;
      padding: 15px;
      border: 3px solid black;
      margin: 0px;
    }
  25. 25.🔠 How many headings are in this code?
    <h1>My pets</h1>
    <p>Good morning!</p>
    <p>Our school trip</p>
    <h4>Fun facts</h4>
    <p>My best friend</p>
  26. 26.🎯 What kind of selector is .star? (a) an element selector (b) a class selector (c) an id selector
  27. 27.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="bus.jpg" alt="Our school bus" width="150">
    (a) Our school bus (b) An old fort (c) bus.jpg (d) width
  28. 28.Which of these is the border? (a) space outside the border (b) the gap to other boxes (c) a solid or dotted edge (d) space inside the border
  29. 29.🖼️ How many pixels wide is the picture drawn?
    <img src="map.png" alt="Map of India" width="250">
  30. 30.📝 What does <hr> draw? (a) a picture (b) a link (c) a table (d) a line across the page
  31. 31.Which of these goes in the head? (a) <h1> (b) <ul> (c) <img> (d) <title>
  32. 32.🔒 Is the connection to this address scrambled (encrypted)?
    http://www.example.net/index.html
    (a) No (b) Yes
  33. 33.🔢 To build and share your first web page, which comes first: “add CSS styles” or “write the HTML”? (a) add CSS styles (b) write the HTML
  34. 34.🔗 Which code links to about.html? (a) <a src="about.html"> (b) <a alt="about.html"> (c) <a href="about.html"> (d) <link about.html>
  35. 35.🔢 To build and share your first web page, which comes first: “publish it online” or “test in a browser”? (a) test in a browser (b) publish it online
  36. 36.True or false: “use big enough text” makes the page harder to use. (a) True (b) False
  37. 37.🔠 Which heading shows the BIGGEST text: <h4>, <h3>, <h6> or <h5>? (a) <h3> (b) <h6> (c) <h5> (d) <h4>
  38. 38.🌈 In #rrggbb, which colour do the last two digits give? (a) red (b) blue (c) green (d) white
  39. 39.🏷️ Is </body> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  40. 40.True or false: <hr> has a closing tag. (a) False (b) True

Answer key

  1. 12
  2. False
  3. No
  4. 4
  5. .box
  6. 16
  7. answers page requests
  8. in the head
  9. False
  10. when if is false
  11. <h6>
  12. line 1
  13. src
  14. I love mangoes.
  15. for
  16. yellow
  17. False
  18. an id selector
  19. .note
  20. 8px
  21. child
  22. border
  23. makes it harder
  24. 106
  25. 2
  26. a class selector
  27. Our school bus
  28. a solid or dotted edge
  29. 250
  30. a line across the page
  31. <title>
  32. No
  33. write the HTML
  34. <a href="about.html">
  35. test in a browser
  36. False
  37. <h3>
  38. blue
  39. a closing tag
  40. False

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