← Web development final test lesson New set →

Web Development Worksheet: Final Test

HTML and CSS lesson 30: Web development final test · Set 773 · 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.📄 Where does the text of <title> appear? (a) at the bottom (b) in a big heading (c) on the browser tab (d) nowhere
  2. 2.🔁 How many times does this code print “Hello”?
    for (let i = 3; i < 12; i++) {
      console.log("Hello");
    }
  3. 3.🌍 What do we call the computer that stores a website? (a) a mouse (b) a server (c) a keyboard (d) a printer
  4. 4.💬 Which text will NOT show on the page?
    <p>Rain today</p>
    <p>Good morning!</p>
    <p>Our school trip</p>
    <!-- <p>My pets</p> -->
    (a) Good morning! (b) Rain today (c) Our school trip (d) My pets
  5. 5.🖼️ Which attribute of <img> sets how wide it is? (a) src (b) alt (c) height (d) width
  6. 6.🔠 Which tag is the least important heading? (a) <h3> (b) <h1> (c) <p> (d) <h6>
  7. 7.🎯 Which element does the selector #top style? (a) <h2 class="top"> (b) <h2 id="intro"> (c) <li class="box"> (d) <h2 id="top">
  8. 8.📄 Where does <link rel="stylesheet"> go: in the head or in the body? (a) in the body (b) in the head
  9. 9.♿ Who uses a screen reader? (a) only robots (b) only teachers (c) people who are blind (d) only coders
  10. 10.🔗 Which words do you click on?
    <a href="contact.html">Play games</a>
    (a) About us (b) contact.html (c) href (d) Play games
  11. 11.⚖️ Two rules with the same selector set a colour. Which one wins? (a) neither (b) the later one (c) the first one (d) the shorter one
  12. 12.🧭 Why use <nav> instead of <div> for a menu? (a) it tells its meaning (b) it adds pictures (c) it loads faster (d) it makes text red
  13. 13.🔒 Is the connection to this address scrambled (encrypted)?
    https://www.example.net/maths/tables.html
    (a) Yes (b) No
  14. 14.🧭 How many <main> parts should a page have? (a) one (b) three (c) ten (d) none
  15. 15.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="tiger.jpg" alt="A tiger asleep" width="250">
    (a) A tiger asleep (b) A red kite (c) width (d) tiger.jpg
  16. 16.Which of these is true of a web browser? (a) hosts websites online (b) shows line numbers (c) has an address bar (d) saves our .html files
  17. 17.Which of these does CSS do? (a) shows a pop-up message (b) reacts to a button click (c) changes the text size (d) gives the page structure
  18. 18.📊 In a table, which tag is a row? (a) <tb> (b) <th> (c) <td> (d) <tr>
  19. 19.📝 Does <meta> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
  20. 20.Which of these is true of <nav>? (a) helps you move around (b) holds the logo and title (c) holds a news story (d) holds the main content
  21. 21.💬 Which text will NOT show on the page?
    <p>Cricket is fun.</p>
    <p>Fun facts</p>
    <!-- <p>Rain today</p> -->
    (a) Fun facts (b) Cricket is fun. (c) Rain today
  22. 22.♿ Is this heading order correct (no level skipped)?
    <h1> → <h3> → <h4> → <h4>
    (a) No (b) Yes
  23. 23.What does justify-content: space-between do? (a) packs boxes at the end (b) packs boxes at the start (c) puts boxes in the middle (d) equal gaps, none at ends
  24. 24.🖌️ Which CSS property sets the letter colour? (a) background-color (b) font-size (c) text-align (d) color
  25. 25.🔒 Is the connection to this address scrambled (encrypted)?
    https://www.example.net/about.html
    (a) No (b) Yes
  26. 26.True or false: HTML puts a picture on a page. (a) True (b) False
  27. 27.True or false: a web server saves our .html files. (a) True (b) False
  28. 28.🔁 How many times does this code print “Well done”?
    for (let i = 3; i <= 12; i++) {
      console.log("Well done");
    }
  29. 29.✍️ Which sign ends each CSS declaration? (a) , (b) : (c) . (d) ;
  30. 30.🔁 What does this code print?
    let age = 42;
    if (age >= 26) {
      console.log("teen");
    } else {
      console.log("child");
    }
    (a) child (b) teen
  31. 31.🖌️ What colour are the letters?
    h2 {
      font-size: 36px;
      text-align: right;
      color: orange;
      background-color: black;
    }
    (a) orange (b) white (c) black
  32. 32.True or false: JavaScript sets colours and fonts. (a) False (b) True
  33. 33.⚡ What does this code show?
    let name = "Kabir";
    alert("Well done, " + name + "!");
    (a) Well done, name! (b) Kabir (c) name (d) Well done, Kabir!
  34. 34.True or false: <table> makes one table row. (a) True (b) False
  35. 35.🎯 Which CSS selector matches this element?
    <h2 class="red" id="logo">Hello</h2>
    (a) #logo (b) li (c) #red (d) .logo
  36. 36.💪 How much empty space (px) is left after the last box?
    .row {
      display: flex;
      width: 220px;
      justify-content: flex-start;
    }
    Inside are 4 boxes, each 50px wide (no margins).
  37. 37.Which of these is the content? (a) the line round the box (b) the text or picture (c) a solid or dotted edge (d) the gap round content
  38. 38.✍️ What value is given to font-weight in this rule?
    h2 {
      width: 300px;
      font-weight: bold;
      background-color: yellow;
    }
    (a) font-weight (b) bold (c) 2px solid (d) 300px
  39. 39.🖼️ Which attribute of <img> tells which image to load? (a) alt (b) height (c) width (d) src
  40. 40.💬 How does an HTML comment end? (a) // (b) --> (c) */ (d) >>

Answer key

  1. on the browser tab
  2. 9
  3. a server
  4. My pets
  5. width
  6. <h6>
  7. <h2 id="top">
  8. in the head
  9. people who are blind
  10. Play games
  11. the later one
  12. it tells its meaning
  13. Yes
  14. one
  15. A tiger asleep
  16. has an address bar
  17. changes the text size
  18. <tr>
  19. an empty tag
  20. helps you move around
  21. Rain today
  22. No
  23. equal gaps, none at ends
  24. color
  25. Yes
  26. True
  27. False
  28. 10
  29. ;
  30. teen
  31. orange
  32. False
  33. Well done, Kabir!
  34. False
  35. #logo
  36. 20
  37. the text or picture
  38. bold
  39. src
  40. -->

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