← Web development final test lesson New set →

Web Development Worksheet: Final Test

HTML and CSS lesson 30: Web development final test · Set 897 · 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 colour is the text of this element?
    <h2 class="note" id="main">Hi</h2>
    CSS:
    #main { color: blue; }
    #main { color: orange; }
    (a) orange (b) blue (c) white (d) black
  2. 2.🧭 Which semantic tag holds the logo and title? (a) <footer> (b) <article> (c) <header> (d) <nav>
  3. 3.📝 On how many lines does the browser show this paragraph?
    <p>Sky is blue<br>Stars shine</p>
  4. 4.True or false: score = score + 1; goes in script.js. (a) True (b) False
  5. 5.🔁 How many times does this code print “Hi”?
    for (let i = 0; i <= 8; i++) {
      console.log("Hi");
    }
  6. 6.✍️ How many declarations (property: value pairs) are in this rule?
    .box {
      background-color: yellow;
      margin: 10px;
      border: 2px solid;
    }
  7. 7.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 190px;
      padding: 30px;
      border: 2px solid black;
      margin: 0px;
    }
  8. 8.⚖️ Which selector is the strongest? (a) an element selector (b) an id selector (c) a class selector
  9. 9.🔢 When you open a web page, which comes first: “DNS finds the server” or “the server sends files”? (a) the server sends files (b) DNS finds the server
  10. 10.📄 Where does <style> go: in the head or in the body? (a) in the head (b) in the body
  11. 11.🔗 Which words do you click on?
    <a href="contact.html">Play games</a>
    (a) Play games (b) contact.html (c) href (d) About us
  12. 12.Which of these is an opening tag? (a) </p> (b) </li> (c) <h1> (d) </h1>
  13. 13.🔁 How many numbers does this code print?
    for (let i = 0; i < 10; i = i + 2) {
      console.log(i);
    }
  14. 14.Which of these goes in the head? (a) <h1> (b) <link rel="stylesheet"> (c) <p> (d) <ul>
  15. 15.📄 Can HTML on its own make tables? (a) No (b) Yes
  16. 16.♿ Is this heading order correct (no level skipped)?
    <h1> → <h3> → <h3> → <h4>
    (a) No (b) Yes
  17. 17.⚖️ What colour is the text of this element?
    <h1 class="box" id="hero">Hi</h1>
    CSS:
    h1 { color: green; }
    .box { color: red; }
    (a) black (b) green (c) red (d) blue
  18. 18.⚖️ What colour is the text of this element?
    <h1 class="note" id="top">Hi</h1>
    CSS:
    .note { color: red; }
    .note { color: green; }
    (a) yellow (b) red (c) purple (d) green
  19. 19.📊 How many rows does this table have?
    <table>
      <tr><td>Litchi</td><td>Litchi</td><td>Jamun</td><td>Grapes</td></tr>
      <tr><td>Orange</td><td>Banana</td><td>Guava</td><td>Mango</td></tr>
      <tr><td>Jamun</td><td>Orange</td><td>Litchi</td><td>Jamun</td></tr>
    </table>
  20. 20.📝 At most, how many of these can be chosen at the same time?
    <form>
      <input type="checkbox" name="sport"> Cricket
      <input type="checkbox" name="sport"> Hockey
      <input type="checkbox" name="sport"> Football
    </form>
  21. 21.🚀 Which file should this code go in: .box { padding: 8px; } (a) style.css (b) script.js (c) index.html
  22. 22.🔁 What number does this code print?
    let total = 0;
    for (let i = 1; i <= 5; i++) {
      total = total + 9;
    }
    console.log(total);
  23. 23.🌍 What is the path in this URL?
    https://www.example.com/about.html
    (a) www.example.com (b) https (c) /about.html (d) /maths/tables.html
  24. 24.Which colour pair is easy to read? (a) red on green (b) yellow on black (c) yellow on white (d) blue on purple
  25. 25.🧭 How many <main> parts should a page have? (a) three (b) none (c) one (d) ten
  26. 26.🖼️ Why do we add alt text to an image? (a) to load it faster (b) to describe the image (c) to make it bigger (d) to colour it
  27. 27.🌈 Which colour is rgb(0, 0, 255)? (a) cyan (b) magenta (c) blue (d) black
  28. 28.Which of these is true of a code editor? (a) has an address bar (b) answers page requests (c) colours code to help us (d) hosts websites online
  29. 29.🎯 Which CSS selector matches this element?
    <li class="menu" id="top">Hello</li>
    (a) #menu (b) .top (c) div (d) #top
  30. 30.Which of these goes in the head? (a) <ul> (b) <meta charset="utf-8"> (c) <p> (d) <table>
  31. 31.💬 How does an HTML comment start? (a) /* (b) # (c) <!-- (d) //
  32. 32.Which colour pair is easy to read? (a) blue on purple (b) light grey on white (c) red on green (d) black on white
  33. 33.📋 Which list suits a shopping list in any order? (a) <ol> (b) <br> (c) <hr> (d) <ul>
  34. 34.💬 How many paragraphs show on the page?
    <!-- <p>Hello, world!</p> -->
    <!-- <p>My best friend</p> -->
    <p>My pets</p>
    <p>I love mangoes.</p>
  35. 35.📱 The screen is 414px wide. Does the rule inside @media apply?
    p {
      font-size: 16px;
    }
    @media (min-width: 600px) {
      p {
        font-size: 22px;
      }
    }
    (a) No (b) Yes
  36. 36.🖼️ Which attribute of <img> names the picture file? (a) alt (b) src (c) width (d) height
  37. 37.True or false: #end is a class selector. (a) False (b) True
  38. 38.🖼️ Which picture file does the browser load?
    <img src="tiger.jpg" alt="A tiger asleep" width="100">
    (a) A tiger asleep (b) kite.png (c) map.png (d) tiger.jpg
  39. 39.💬 Which text will NOT show on the page?
    <p>Good morning!</p>
    <p>I love mangoes.</p>
    <p>Fun facts</p>
    <!-- <p>Hello, world!</p> -->
    (a) Good morning! (b) I love mangoes. (c) Fun facts (d) Hello, world!
  40. 40.⚡ What does this code print? (Look at the quotes!)
    let x = "3";
    let y = 3;
    console.log(x + y);
    (a) Error (b) 6 (c) 33

Answer key

  1. orange
  2. <header>
  3. 2
  4. True
  5. 9
  6. 3
  7. 254
  8. an id selector
  9. DNS finds the server
  10. in the head
  11. Play games
  12. <h1>
  13. 5
  14. <link rel="stylesheet">
  15. Yes
  16. No
  17. red
  18. green
  19. 3
  20. 3
  21. style.css
  22. 45
  23. /about.html
  24. yellow on black
  25. one
  26. to describe the image
  27. blue
  28. colours code to help us
  29. #top
  30. <meta charset="utf-8">
  31. <!--
  32. black on white
  33. <ul>
  34. 2
  35. No
  36. src
  37. False
  38. tiger.jpg
  39. Hello, world!
  40. 33

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