← Web development final test lesson New set →

Web Development Worksheet: Final Test

HTML and CSS lesson 30: Web development final test · Set 283 · 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.📊 How many rows does this table have?
    <table>
      <tr><td>Guava</td><td>Grapes</td><td>Mango</td></tr>
      <tr><td>Papaya</td><td>Guava</td><td>Papaya</td></tr>
    </table>
  2. 2.🔠 Are headings shown in bold by default? (a) No (b) Yes
  3. 3.🔤 In “HTML”, what do the letters HT stand for? (a) Home Text (b) Hot Tags (c) HyperText (d) High Tech
  4. 4.🔁 How many times does this code print “Hi”?
    for (let i = 3; i <= 12; i++) {
      console.log("Hi");
    }
  5. 5.True or false: the URL scrambles data on its way. (a) True (b) False
  6. 6.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Space Facts</title>
    </head>
    <body>
      <h1>Easy snacks</h1>
      <p>Thanks for visiting.</p>
    </body>
    </html>
    (a) index.html (b) Easy snacks (c) Space Facts (d) Thanks for visiting.
  7. 7.🔠 Which heading shows the BIGGEST text: <h2>, <h5>, <h1> or <h4>? (a) <h1> (b) <h2> (c) <h4> (d) <h5>
  8. 8.⚖️ Which selector is the weakest? (a) an id selector (b) an element selector (c) a class selector
  9. 9.📦 In the box model, which part is the text or picture? (a) padding (b) margin (c) content (d) border
  10. 10.💪 Which justify-content value packs boxes at the start? (a) space-between (b) flex-end (c) flex-start (d) center
  11. 11.📝 How many paragraphs does this code make?
    <p>Good morning!</p>
    <h2>Hello, world!</h2>
    <p>Hello, world!</p>
    <h2>The red kite</h2>
    <h2>My best friend</h2>
    <h2>Cricket is fun.</h2>
  12. 12.⚡ A JavaScript file usually ends with which extension? (a) .js (b) .css (c) .jpg (d) .html
  13. 13.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="dog.jpg" alt="A happy dog" width="300">
    (a) dog.jpg (b) width (c) A happy dog (d) The full moon
  14. 14.⚡ Where does console.log() show its output? (a) in the address bar (b) in the console (c) on the printer (d) on the title bar
  15. 15.🔁 What does this code print?
    let score = 17;
    if (score > 38) {
      console.log("You win");
    } else {
      console.log("Play again");
    }
    (a) You win (b) Play again
  16. 16.What is <input type="password"> for? (a) takes only numbers (b) is for one line of words (c) sends the form (d) hides what you type
  17. 17.🖼️ Which attribute of <img> names the picture file? (a) src (b) height (c) width (d) alt
  18. 18.🌍 What is the domain name in this URL?
    http://www.example.net/games/chess.html
    (a) learn.example.com (b) /games/chess.html (c) www.example.net (d) http
  19. 19.📦 How much space across (px) does this box take in all, margin included?
    .box {
      width: 120px;
      padding: 25px;
      border: 2px solid black;
      margin: 0px;
    }
  20. 20.📊 Are <th> cells shown bold and centred by default? (a) Yes (b) No
  21. 21.⚡ What number does this code print?
    let books = 27;
    books = books + 11;
    books = books - 15;
    console.log(books);
  22. 22.🌈 How many pairs of hex digits are in a colour like #ff8800? (a) 4 (b) 2 (c) 3 (d) 6
  23. 23.🔤 In “HTML”, what does the L stand for? (a) Link (b) Language (c) Laptop (d) Line
  24. 24.What does text-align do? (a) colours behind the text (b) makes letters bigger (c) centres a heading (d) picks the font style
  25. 25.🔁 What does this code print?
    let score = 36;
    if (score >= 39) {
      console.log("You win");
    } else {
      console.log("Play again");
    }
    (a) You win (b) Play again
  26. 26.🚀 Which file should this code go in: body { margin: 0; } (a) script.js (b) style.css (c) index.html
  27. 27.🏷️ Is </title> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  28. 28.🎯 Which CSS selector matches this element?
    <h2 class="box" id="top">Hello</h2>
    (a) li (b) .star (c) #box (d) h2
  29. 29.True or false: in <img>, alt describes the picture. (a) True (b) False
  30. 30.🌐 Which one shows line numbers? (a) a web server (b) a web browser (c) a code editor
  31. 31.True or false: HTML on its own can make headings. (a) False (b) True
  32. 32.♿ Does this help everyone, or make the page harder to use: label every form box? (a) makes it harder (b) helps everyone
  33. 33.📝 Which tag gives a form box a name you can click? (a) <label> (b) <h1> (c) <title> (d) <hr>
  34. 34.🎯 Which element does the selector .note style? (a) <h2 class="big"> (b) <h2 class="note"> (c) <li class="red"> (d) <h2 id="note">
  35. 35.🔠 Which heading shows the SMALLEST text: <h4>, <h3>, <h6> or <h2>? (a) <h4> (b) <h2> (c) <h6> (d) <h3>
  36. 36.📝 Does <img> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
  37. 37.⚡ Which JavaScript word writes in the console? (a) console.log() (b) let (c) alert() (d) for
  38. 38.🔐 Is abcd1234 a strong or a weak password? (a) strong (b) weak
  39. 39.♿ Does this help everyone, or make the page harder to use: use headings in order? (a) helps everyone (b) makes it harder
  40. 40.🏷️ Is <h1> an opening tag or a closing tag? (a) an opening tag (b) a closing tag

Answer key

  1. 2
  2. Yes
  3. HyperText
  4. 10
  5. False
  6. Space Facts
  7. <h1>
  8. an element selector
  9. content
  10. flex-start
  11. 2
  12. .js
  13. A happy dog
  14. in the console
  15. Play again
  16. hides what you type
  17. src
  18. www.example.net
  19. 174
  20. Yes
  21. 23
  22. 3
  23. Language
  24. centres a heading
  25. Play again
  26. style.css
  27. a closing tag
  28. h2
  29. True
  30. a code editor
  31. True
  32. helps everyone
  33. <label>
  34. <h2 class="note">
  35. <h6>
  36. an empty tag
  37. console.log()
  38. weak
  39. helps everyone
  40. an opening tag

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