← Web development final test lesson New set →

Web Development Worksheet: Final Test

HTML and CSS lesson 30: Web development final test · Set 200 · 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.🔢 In a basic web page file, which comes FIRST? (a) <body> (b) <head> (c) <!DOCTYPE html> (d) </head>
  2. 2.⚖️ What colour is the text of this element?
    <p class="big" id="top">Hi</p>
    CSS:
    p { color: white; }
    #top { color: green; }
    (a) white (b) orange (c) red (d) green
  3. 3.🔁 Which loop repeats code a set number of times? (a) if (b) for (c) let (d) else
  4. 4.🔁 How many times does this code print “Welcome”?
    for (let i = 2; i <= 8; i++) {
      console.log("Welcome");
    }
  5. 5.Which of these is the content? (a) the text or picture (b) the line round the box (c) space outside the border (d) space inside the border
  6. 6.🔠 Are headings shown in bold by default? (a) Yes (b) No
  7. 7.⚖️ What colour is the text of this element?
    <h2 class="big" id="logo">Hi</h2>
    CSS:
    .big { color: red; }
    h2 { color: green; }
    (a) purple (b) yellow (c) green (d) red
  8. 8.⚡ What number does this code print?
    let a = 42;
    let b = 30;
    console.log(a + b);
  9. 9.📊 How many cells does this table have in all?
    <table>
      <tr><th>Name</th><th>Fruit</th><th>Price</th></tr>
      <tr><td>Papaya</td><td>Jamun</td><td>Litchi</td></tr>
      <tr><td>Guava</td><td>Banana</td><td>Guava</td></tr>
    </table>
  10. 10.⚡ What number does this code print?
    let books = 7;
    books = books + 4;
    books = books - 3;
    console.log(books);
  11. 11.What is <input type="date"> for? (a) picks a day (b) sends the form (c) lets you pick only one (d) hides what you type
  12. 12.💬 How does an HTML comment end? (a) // (b) >> (c) */ (d) -->
  13. 13.🌈 Which hex code is red? (a) #00ffff (b) #ff0000 (c) #000000 (d) #ffff00
  14. 14.📄 Where does <p> go: in the head or in the body? (a) in the head (b) in the body
  15. 15.🌍 What is the path in this URL?
    http://www.example.net/about.html
    (a) /about.html (b) www.example.net (c) /maths/tables.html (d) http
  16. 16.🌍 What is the domain name in this URL?
    https://kids.example.org/about.html
    (a) https (b) /about.html (c) school.example.in (d) kids.example.org
  17. 17.⚡ What does this code show?
    let name = "Riya";
    console.log("Hello, " + name + "!");
    (a) Hello, name! (b) Hello, Riya! (c) Riya (d) name
  18. 18.🔗 Which attribute holds the address of a link? (a) id (b) href (c) src (d) alt
  19. 19.🖼️ Which attribute of <img> describes the picture? (a) height (b) alt (c) src (d) width
  20. 20.🌈 Which colour is #0000ff? (a) cyan (b) yellow (c) bright green (d) blue
  21. 21.Which of these is an empty tag? (a) <p> (b) <b> (c) <hr> (d) <ul>
  22. 22.📝 What do we need to write HTML? (a) a paintbrush (b) a microphone (c) a printer (d) a plain text editor
  23. 23.Which of these is padding? (a) a solid or dotted edge (b) the line round the box (c) the gap to other boxes (d) space inside the border
  24. 24.💬 Which text will NOT show on the page?
    <!-- <p>Fun facts</p> -->
    <p>Good morning!</p>
    <p>I love mangoes.</p>
    <p>Rain today</p>
    (a) Good morning! (b) I love mangoes. (c) Fun facts (d) Rain today
  25. 25.Which of these is a strong password? (a) 111111 (b) Rain#Drop_42! (c) qwerty (d) password
  26. 26.🔁 What number does this code print?
    let total = 0;
    for (let i = 1; i <= 4; i++) {
      total = total + 9;
    }
    console.log(total);
  27. 27.🏷️ Which is the closing tag for <h2>? (a) <h2/> (b) <\h2> (c) </h2> (d) <h2>
  28. 28.✍️ How many declarations (property: value pairs) are in this rule?
    p {
      padding: 8px;
      margin: 10px;
    }
  29. 29.⚡ What number does this code print?
    let a = 2;
    let b = 2;
    console.log(a * b);
  30. 30.🌍 Which one asks for a web page? (a) the browser (b) HTTPS (c) the server (d) the URL
  31. 31.🛡️ Online: is it safe to keep passwords secret? (a) not safe (b) safe
  32. 32.🖼️ How many pixels wide is the picture drawn?
    <img src="moon.png" alt="The full moon" width="150">
  33. 33.Which of these is an empty tag? (a) <title> (b) <h1> (c) <img> (d) <b>
  34. 34.Which of these is padding? (a) the gap round content (b) the gap to other boxes (c) the text or picture (d) a solid or dotted edge
  35. 35.True or false: <p> has a closing tag. (a) False (b) True
  36. 36.🔁 What is the LAST number this code prints?
    for (let i = 0; i < 11; i = i + 2) {
      console.log(i);
    }
  37. 37.True or false: <th> gives the table a title. (a) False (b) True
  38. 38.🌍 What is the protocol in this URL?
    https://kids.example.org/index.html
    (a) http (b) /index.html (c) https (d) kids.example.org
  39. 39.🧭 Which semantic tag holds one blog post? (a) <main> (b) <article> (c) <footer> (d) <aside>
  40. 40.True or false: HTML makes a link. (a) False (b) True

Answer key

  1. <!DOCTYPE html>
  2. green
  3. for
  4. 7
  5. the text or picture
  6. Yes
  7. red
  8. 72
  9. 9
  10. 8
  11. picks a day
  12. -->
  13. #ff0000
  14. in the body
  15. /about.html
  16. kids.example.org
  17. Hello, Riya!
  18. href
  19. alt
  20. blue
  21. <hr>
  22. a plain text editor
  23. space inside the border
  24. Fun facts
  25. Rain#Drop_42!
  26. 36
  27. </h2>
  28. 2
  29. 4
  30. the browser
  31. safe
  32. 150
  33. <img>
  34. the gap round content
  35. True
  36. 10
  37. False
  38. https
  39. <article>
  40. True

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